proposal for a new css combinator

Hi all,

 

I'm quite sure that someone before me must've thought about this, or
maybe I just didn't look closely enough at the latest specs, but I
believe we are missing an important css combinator. 

 

For the full explanation you can check the following article:
http://www.onderhond.com/blog/work/missing-css-combinator

 

In short, I'd like something between the space and child combinator. A
combinator that allows for an (x) number of levels between parent and
child, but stops at the first matching level it hits.

 

For example (assuming the % symbol would be used for the combinator):
..box%header would match the header element of the .box component, but no
other header elements of nested components inside the .box. The child
combinator could be used, but adding a wrapping element (structural -
div or functional - a or form) would break the css, which is not a good
thing.

 

This would allow us to style components in a flexible way without the
trouble of breaking the css with wrapping elements and without css rules
spilling over to nested components of a different kind.

 

Has this been raised before? Any thoughts? Any reason why this would be
a bad idea?

 

Input appreciated!

 

Greets,

Niels Matthijs

Internet Architects

Received on Wednesday, 13 January 2010 12:06:46 UTC