Re: Thinking about mixins as a new type of selector

I know this idea isn't new and that many versions have been found wanting,
but we did do work to flesh out what an acceptable syntax might look like a
year+ ago. The most visible aspects of that work are part of the ExCSS repo:

   http://code.google.com/p/experimental-css/

You can get a sense for it here:


http://code.google.com/p/experimental-css/source/browse/style_examples/button2.html

Obviously, it may not be ideal, but the use of @ rules for declaration and
use seemed to fit well in the grammar at the time. Tab may have more
thoughts.


On Sun, Aug 12, 2012 at 11:40 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> This is very interesting!
>
> fantasai and I had just discussed the issue of selector variables a
> few days ago, and returned to her @define rule as a useful model
> (identical to my original conception of @var declaring global
> variables).
>
> This, though, presents a very intriguing spin on that idea, where the
> definition of the variable is spread out over potentially multiple
> declarations.  This seems like it hits closer to the idea of SASS's
> @extend, which I've been wanting to give some serious thought to (at
> Chris Eppstein's repeated urging ^_^).
>
> I'm curious about the intersection of this with global variables.  If
> this claims the syntax of $foo on the global level solely for
> selectors, it prevents us from using similarly simple syntax for
> variables in MQ or elsewhere.  This might be sufficiently useful for
> that to be acceptable.
>
> I'll want to give this some thought, and discuss it with Nicole,
> Chris, and others from the community who have experience with @extend
> and similar preprocessor constructs.  Thanks for the proposal, David!
>
> ~TJ
>
>

Received on Monday, 13 August 2012 13:56:23 UTC