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

Rewriting attribute selectors is lossy #10

Closed
jimmyfrasche opened this issue Feb 28, 2015 · 2 comments
Closed

Rewriting attribute selectors is lossy #10

jimmyfrasche opened this issue Feb 28, 2015 · 2 comments

Comments

@jimmyfrasche
Copy link

Using div[id=a] instead of div#a is a valid technique for matching an id with lower specificity than the id selector.

Using div[class=a] is not the same as div.a. The former matches a div with only class a and no others.

This minification is not safe. It changes the semantics of the rules.

@tdewolff
Copy link
Owner

tdewolff commented Mar 1, 2015

Thanks for the find. To be clear, only the minification for classes is unsafe or do you think the minification for ID's is unsafe too? A lower specificity could cause problems...

@jimmyfrasche
Copy link
Author

They are both unsafe in that they change the intent of what was written. The lower specificity makes it easier to override in, say, a media query.

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

No branches or pull requests

2 participants