Re: CSS Hierarchies / Selector Nesting Proposal

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 UTC