W3C home > Mailing lists > Public > www-style@w3.org > January 2010

RE: proposal for a new css combinator

From: Niels Matthijs <niels.matthijs@internetarchitects.be>
Date: Wed, 13 Jan 2010 15:22:04 -0000
Message-ID: <EAD6F36F8B8A124FB32D722A828211FD0BDD7E16@win-s-manc3.shared.ifeltd.com>
To: "Brad Kemper" <brad.kemper@gmail.com>
Cc: "www-style list" <www-style@w3.org>
>> It's not especially elegant, but gets the job done, I think.

 

Indeed, but as you stated already, it's not very elegant.

 

1/ when you change something to the focus header you have to reset it
for whatever components are nested

2/ when you nest a new component you have to reset all the styles again.

 

But even worse!

 

3/ what if the second heading can't be reset. Imagine the focus heading
has a padding of 1em. The second heading has a padding of 0.5em;
Depending on where all of this is placed in your css you have to do a
whole lot of rewriting and redefining the same values (for no good
reason really).

 

Imo, this is not really acceptable behaviour.  Probably okay and doable
10 years ago, but if you want to deliver quality work to your clients
you should be able to build more robust and flexible solutions, allowing
nestings that don't pick up any unneeded styles (especially handy when
building a framework where you don't even know what will be nested.

 

From: Brad Kemper [mailto:brad.kemper@gmail.com] 
Sent: 13 January 2010 15:36
To: Niels Matthijs
Cc: www-style list
Subject: Re: proposal for a new css combinator

 

 

On Jan 13, 2010, at 4:02 AM, Niels Matthijs wrote:





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

 

I think in general, you could achieve your aims (including IE6
compatibility) with something like the following, right?

 

..focusBlock header { /* stying for first level of header in the focus
block */  }

..focusBlock header header { /* reset any styles you don't want in
subsequent header descendants  */  }

 

It's not especially elegant, but gets the job done, I think.
Received on Wednesday, 13 January 2010 15:30:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:23 GMT