Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No. !important supplied by the user is always higher than !important supplied by the author (and the opposite is true for non-!important), regardless of specificity. Specificity only comes into play when considering two rules supplied by the user or two rules supplied by the author.

If user agent style sheets are removed from the engine, then extensions will have to start considering specificity when adding style sheets to the end of the list, because they'll all be considered "author" rules. But user style sheets shouldn't have to worry about specificity, per the spec.



That would break how CSS works. I don't like it.


He is describing how CSS is spec'ed to work right to you. The proposed Chrome change would be breaking how CSS works.


Yes I understand, but I wouldn't want that in a chrome extension personally. It could make styling harder. When you nuke rules without considering specificity it can cause unintended consequences. If everything just followed regular CSS rules as if all CSS was applied by the author there would be less of a chance of changing something you hadn't intended to change.


The people who use user style sheets (especially !important rules) in CSS aren't particularly interested in your styling. They're interested in the content in a style that works for them.

This is an important accessibility feature of CSS and I'm disturbed at any reduction in support for this feature.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: