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
"p{foo:bar;foo:baz}" and "p{foo:bar}p{foo:baz}" are minified differently #532
Comments
This is in fact intentional, as take the following two declarations: a{display:inline-block;display:block} a{display:inline-block}/* some other properties */a{display:block} In the first one, you declare two display properties adjacent to each other so it's highly likely you want to do a fallback, when one is not understood (more on this in a second) then the other one is picked. It's a common pattern in CSS. In the 2nd one these are in two different selectors so it's less likely the author intention was to have a fallback, thus the display:block overrides display:inline-block. However this is far from perfect so we started merging properties based on understandability, where less understandable properties (take Ultimately it will be implemented for all properties, see #290, but you can get a safer behavior using Hope this helps! |
That behavior makes sense when processing hand-crafted CSS, which is not my use case.
I ended up switching to |
You can get the same behavior in clean-css by using |
My bad, I meant A casting error on my side :-) |
Ok, makes sense now! I'll close the issue now. |
This may or may not be intentional, but I was surprised by the following:
If I pass
{advanced:true}
{advanced:false}
to the constructor, the second example produces"p{foo:bar}p{foo:baz}"
instead.I'm using
clean-css
to normalize style sheets to test a JS to CSS compiler (probably an anathema for designers, I know), but I can't get it to behave accordingly in this case, where my code generates"p{foo:bar}p{foo:baz}"
.The text was updated successfully, but these errors were encountered: