Tuesday, April 27, 2010

Ideas for future revisions of CSS

CSS nesting so I could do something like div.class { /* everything in here applies to descendants of div.class */ h3 { text-align: right; } h2 { color: red; } }. Also you would want to allow importing of external CSS inside curly braces, so that the imported CSS would be effective only within that tag. This would have a sort of namespace effect, so that a page can import CSS from disparate sources without conflict.

Another big thing would be the parent selector. I'd suggest '<' since '>' already specifies the parent to child relationship. This would enable relative CSS paths selectors that depend on children. So "span.someclass < div.otherclass" would select div.otherclass elements that have span.someclass as direct children. You would need an ancestor selector systax as well, perhaps '^'.
I got a used scooter the weekend before last. I got it insured, bought a helmet, and got my motorcycle learner's permit. I rode it to work for the first time today. It should save me some money riding it to work for the summer.