Re: CSS Mixins proposal

On Mon, Mar 21, 2011 at 3:04 PM, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
> * Tab Atkins Jr. wrote:
>>On the CSSOM side, Traits would be a new type of CSSRule.  I'm not
>>*entirely* sure how the @mixin would be represented, because we
>>haven't yet had to worry about @-rules inside of declaration blocks.
>
> Yes, that is because the CSS Working Group has been promising not to
> introduce syntax such as you are proposing since the 1990s. If you want
> to use something other than `name: value` in rule sets, you'll have to
> persuade the CSS Working Group to give up this whole stable syntax idea.

Putting @-rules into declaration blocks was floated at April 2010 FtF
(possibly in the context of mixins? I forget).  Yes, it requires
changes to the Core Grammar.  Assuming that a legacy parser actually
follows the current CSS grammar, though, we can easily make
@-rules-in-declaration-blocks still fail in a forward-compatible way:
either require that @-rules go at the end of the block, or require
that they be ended with a ";".  Either strategy would make the
"invalid" blocks fail in a contained fashion, allowing the rest of the
stylesheet to still work as if they weren't there.



On Mon, Mar 21, 2011 at 3:05 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 03/21/2011 12:55 PM, Tab Atkins Jr. wrote:
>>
>> Thoughts?
>
> Aside from the named arguments bit, it seems a lot like
>  http://fantasai.inkedblade.net/style/specs/constants/

Yes, it's essentially the same as your "@define stylesets {}" block,
just with arguments, and with the same global behavior as Variables,
rather than the more complex scoping you suggest for @define.



On Mon, Mar 21, 2011 at 3:18 PM, Alex Mogilevsky <alexmog@microsoft.com> wrote:
> This is not instead of variables, it is in addition - right?

Correct, this is separate from (though complementary with) Variables.

~TJ

Received on Monday, 21 March 2011 22:51:18 UTC