CSS code validation
As a frequent user of the code editor and a builder that surrounds each of the variants I build with their own unique DOM ID so that I can prefix each CSS rule with same ID and eliminate any possibility of style bleed into other areas of the page
I would like to see some of the current CSS validation remarks related to ID use removed. the list includes the following but their may be more:
1. 'don't use ids as selectors' (as it is 100% valid CSS and actually faster in the rendering engine)
2. 'really, 2 ids?' - yes. it is actually common for me. I always surround my variant with its own unique id and there may be downstream ids that I need to modify. pretty common actually.
So that I can have a warning list that is accurate and useful.
The current model results in a warning list that is actually unusable for me because every single line shows up with a warning because I use IDs in every single rule. I understand the models that recommend only classnames to be used, I just don't adhere to them, I write object-oriented CSS for speed and efficiency. IDs in CSS and the DOM are a valid and effective construct if used properly. Given the number of models out there, it is probably best to only warn when rules have actual potential issues.
This is something that hasn't been reviewed in some time.
We plan to rework how developers work with WEB later this year. We will take this into account.
-
Kristian Reich
commented
Also, 'unset' is valid CSS.
Per mozilla.com: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/unset
The unset CSS keyword resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. In other words, it behaves like the inherit keyword in the first case, when the property is an inherited property, and like the initial keyword in the second case, when the property is a non-inherited property.
unset can be applied to any CSS property, including the CSS shorthand property all.