Re: Thinking about mixins as a new type of selector

On Sun, Aug 12, 2012 at 5:35 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Sunday 2012-08-12 22:37 +0200, François REMY wrote:
>> The main issue is that this loop back. You have to resolve all
>> matching rules to know what the value of "matches" is, but then you
>> have to rematch again, which may changes the value of "matches"
>> again. Potentially, this can become an inifinite loop.
>
> So the 'matches' wasn't intended to be a normal property:  the idea
> was that it would be additive rather than cascading/overriding; I
> think Tab's @-rule syntax might be better.
>
> (I actually started writing the email hoping to post no syntax at
> all, but couldn't figure out an easy way to do so.)
>

Ah, ok.

We have two processing options for such features in principle:

So called @const - C pre-processor kind of parsing.
"@const name tokens;" declaration is a named sequence of parsed
tokens that gets injected at @name; location.

And run-time @var name single-value; thing. It gets parsed into the value
and used as named reference at run-time. Changing the value through
CSSOM will changed all rules where such var is used.

It appears as your $match idea is just a specialization of @const
see: http://wiki.csswg.org/ideas/constants#const-at-rule.

May be its time to return to @const ideas?


-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Monday, 13 August 2012 16:30:55 UTC