Showing posts with label CSS4 CSS Future. Show all posts
Showing posts with label CSS4 CSS Future. Show all posts

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 '^'.