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

Re: Nesting declaration blocks

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Tue, 19 Oct 2010 10:34:20 +0200
Message-Id: <13D587D6-9F97-4F12-B2D4-1A1F5D6F4912@crissov.de>
To: www-style list <www-style@w3.org>
Tab Atkins Jr.:
> 
> Using @-rules, you could introduce nesting with only the minimal grammar breaking we talked about.

Minimal breaking is like minimal pregnant.

> #header {prop: value;
>  @nest(img) {prop: value;}
>  @nest(> nav) {prop: value;}
> }
>  
> body > article.post > form input[type=checkbox] {prop: value;
>  @this(:checked) {prop: value;}
> }
> 
> my > long > selector > string {prop: value;
>  @this(::before) {prop: value;}
> }

Without stating preferences, could this be written without “nest”, “this” and parentheses?

  #header {prop: value;
    @ img {prop: value;}
    @> nav {prop: value;}
  }
  
  body > article.post > form input[type=checkbox] {prop: value;
    @:checked {prop: value;}
  }
  
  my > long > selector > string {prop: value;
    @::before {prop: value;}
  }

What result would the following ruleset give for “foo”?

  foo {
    color: green;
    @> bar {bar: quuz;};
    color: red; background: orange;
  }

Was it any different without the semicolon?

  foo {
    color: green;
    @> bar {bar: quuz;}
    color: red; background: orange;
  }

I would expect red on orange for the first case and green on orange for the second one, but I assume you would spec green on transparent for both cases.
Received on Tuesday, 19 October 2010 08:34:54 GMT

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