W3C home > Mailing lists > Public > www-style@w3.org > June 2011

Re: CSS Hierarchies / Selector Nesting Proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 3 Jun 2011 18:37:34 -0700
Message-ID: <BANLkTikTrO9bh4T9=4xHOwMt9pBNba3NPQ@mail.gmail.com>
To: Øyvind Stenhaug <oyvinds@opera.com>
Cc: www-style@w3.org
On Fri, Jun 3, 2011 at 4:46 AM, Øyvind Stenhaug <oyvinds@opera.com> wrote:
> On Thu, 02 Jun 2011 04:12:21 +0200, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>
>> foo {
>>  prop: val;
>>  prop: val;
>>  & bar {
>>    prop: val;
>>  }
>> }
>>
>> The advantage of Hierarchies is that you can keep related styles in the
>> same place, rather than spread across your document, and you can hence
>> more clearly see how various style rules relate to each other. This helps
>> reduce cognitive load on the reader
>
> I would imagine it increases it, since the reader would need to remember the
> context instead of having it explicitly given in the selector.

Experience seems to show the opposite.  We've got a personal CSS
preprocessor that we wrote to play around with features like this, and
it seems like it makes it *much* easier to write moderate-sized
applications.

CSS frameworks like SASS offer similar feedback - people *love*
writing nested selectors, and find it to be much easier to read and
maintain.

~TJ
Received on Saturday, 4 June 2011 01:38:21 GMT

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