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

Re: Nesting declaration blocks

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Wed, 20 Oct 2010 23:10:10 +0200
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
Message-ID: <5fiub6p76qhr788psr6ro6f0aadkhr1r2o@hive.bjoern.hoehrmann.de>
* Tab Atkins Jr. wrote:
>Hmm, @context seems pretty similar.  Presumably you could nest them?

I would think so, but given past discussions around nested at-rules I'd
expect some resistance, less than there used to be though thanks to some
precedents.

>One problem I see is that it doesn't seem like you have any ability to
>refer to style the current context.  That is, it doesn't look like you
>can transform the following:

There are several ways to address specific use cases, you can allow

  @context ... {
    example: example;
    h1 { ... }
  }

Or you can make a special selector to refer to the current context like

  @context ... {
    $ { ... }
    h1 { ... }
  }

or an at-rule like

  @context ... {
    @here { ... }
    ...
  }

And you might allow a selector-ish thing to go with that like

  @context ... {
    @here ... { ... }
  }

And you can carefully design the syntax to permit things like

  @context ... > {
    ...
  }

Or

  @context ... {
    > example { ... }
  }


And whatever else floats your boat. I don't think there is anything that
you could not do or that would be very hard to do by using the @context
approach that would be possible or much simpler using your approach. The
key benefit is that @context is pretty much like @media and as such easy
to understand intuitively.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Wednesday, 20 October 2010 21:10:57 GMT

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