Re: Nesting declaration blocks

* 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 UTC