Sneak Peek Into The Future: Selectors, Level 4 (CSS4) is here
coding.smashingmagazine.com
coding.smashingmagazine.com
Would CSS4 (much prefer) consider stuff like luminance media queries [1], better contrast/color controls to the designer etc.?
[1] http://fremycompany.com/BG/2012/Ambient-light-sensors-and-CS...
I must be missing something here. What's the point of making something yellow if the user is using a screen reader?
Especially the :future looks exciting and can be fun to play with.
article:matches(.active, .visible, #important) {
background: red;
}
I understand what it normally does, but I've never seen it in a selector. article#important {1. how does it know an unchecked checkbox has not been used? 2. why was a class of 'checkbox' added to the checkbox?
"PARENT SELECTOR!"
I've been wanting this for years. One quibble is that it shouldn't be an exclamation, it should be a < character. A ! doesn't semantically make sense. Alternatively, perhaps ! keeps its current designation, but < means immediate ancestor. This would match with > meaning direct descendant.
Many of the other things, I don't see much point. They can be easily done with CSS as it is now. But, it's good to have new things coming up so lets withhold judgment till then.
Makes as much sense as the rest. ! is an operator of selected element in a selector, not a "parent selector". You can combine `!` with children selectors (`E! > F` will select any E with F children, it's equivalent to `xpath(E[F])` no use of the ancestor:: axis), they don't conflict. You don't actually go "back up" the selection chain, the matching engine simply changes which elements are "kept" during the selection process.
> Many of the other things, I don't see much point. They can be easily done with CSS as it is now.
For highly varying values of "easily". :matches requires a preprocessor or lots of repetition; :local-link is pretty much impossible without markup processing; time-dimensional elements emulation require a fair bit of markup and scripting; :indeterminate simply isn't available; and grid-structural pseudo-classes require markup support (and potentially scripting as well if the tables are dynamic)