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

Modifying invalid CSS #460

Closed
jbergstroem opened this issue Feb 16, 2015 · 6 comments
Closed

Modifying invalid CSS #460

jbergstroem opened this issue Feb 16, 2015 · 6 comments
Milestone

Comments

@jbergstroem
Copy link

The behaviour of CleanCSS somewhere between 2.2.x and recent releases of 3.x of this particular case seems to have changed:

body;{body}

In 2.x it the output didn't change (same as input), but testing with 3.0.10 the output looks like this:

body;{:body}

I understand that bets are 'off' since its invalid, but I was under the impression that CleanCSS wouldn't really care whether its invalid or not which makes the addition of the : somewhat suspect.

@jakubpawlowicz
Copy link
Collaborator

Since 3.0 all content is tokenized first, so that's why. Is there a compelling reason to make it work again?

@jbergstroem
Copy link
Author

@jakubpawlowicz no strong arguments other than the notion of being less intrusive, I guess. I'm not in a position where I can control input which means that if the rendered css looks different, "I" [the library] would be to blame.

@XhmikosR
Copy link
Contributor

@jakubpawlowicz: perhaps there can be an error thrown and stop minification? Now, that would probably require using a parser instead of doing the parsing yourself, but perhaps this is the way to go,.i.e. focus on the minification itself.

@jbergstroem
Copy link
Author

There might be levels of intervention as well. I think it's somewhat rare to find 100% conformant css.

@jakubpawlowicz
Copy link
Collaborator

It's rare indeed. I think in this case we should just drop the declaration and issue a warning.

@jakubpawlowicz
Copy link
Collaborator

Due in clean-css 4.

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

3 participants