Re: proposal for a new css combinator

Niels Matthijs wrote:
> Indeed.
> 
> So I guess we have established that the proposed new combinator has no
> solid alternative in the existing css specifications?
> 
> Apart from that, I want to stress the importance of the selector for
> easier (styled) content syndication or working on frameworks. This
> particular issue was a real pain when I was asked to develop a html/css
> framework for a company. My job was to provide html and css for
> components (think building blocks) so they could develop pages of their
> own. 
> 
> This framework actually featured some A->B and B->A nestings, which were
> really horrible to style, especially since there needen't be a limit for
> the level of nestings. 
> 
> For reference, check out the css of the yahoo grids, which clearly
> display a similar problem (unless they reworked it this last year or
> so).
> 
> I checked the scoped css proposal again, but I don't think this would
> provide a good alternative solution.
> 
> Conclusion: I still firmly believe in the need for the new combinator,
> especially with styling components independently in mind.
> 
> (original proposal: 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.)
> 
> Greets,
> Niels Matthijs

So you are saying that you want to match the first descendant of a 
particular element in the DOM. This could be done like first-child and 
would be a structural pseudo-class.



.focusBlock header:first-descendant {
// style rules //
}


In theory you could also have last-descendant.


.focusBlock header:last-descendant {
// style rules //
}


-- 
Alan http://css-class.com/

Received on Thursday, 14 January 2010 12:42:10 UTC