Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change unitless "0" to "px" when scrubbing (e.g. margin) #4

Open
peterflynn opened this issue Jul 10, 2012 · 1 comment
Open

Change unitless "0" to "px" when scrubbing (e.g. margin) #4

peterflynn opened this issue Jul 10, 2012 · 1 comment

Comments

@peterflynn
Copy link
Owner

  1. Scrub a number like this one: margin: 0;

Result: it changes to e.g. margin: 10;, which is ignored by the browser since it has no units.

It would be better if we automatically tack on units, e.g. margin: 10px;. Icing on the cake would be to automatically remove the unit when scrubbing back to zero.

@redmunds
Copy link

I saw the same problem. Note that not all CSS numbers have units (e.g. z-index), so you'll need a lookup table to determine whether value requires units. The line-height property is an intersting case because both numbers and lengths (number+units) are valid.

I don't know if I agree with removing the units when you hit zero, because if the units were not originally "px", then you'll need to manually set it back to what it was. Maybe this feature needs preferences for "strip units when zero" which then requires a "default units" preference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants