W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: Thinking about mixins as a new type of selector

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 16 Aug 2012 00:53:37 -0700
Message-ID: <CAAWBYDD_=rNE=1VUKp1tXnYRXr7pyNv8DzYQm2H3vZpNofcW_g@mail.gmail.com>
To: Brian Kardell <bkardell@gmail.com>
Cc: www-style@w3.org, "L. David Baron" <dbaron@dbaron.org>
On Wed, Aug 15, 2012 at 5:38 PM, Brian Kardell <bkardell@gmail.com> wrote:
> On Aug 15, 2012 8:18 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>> Example 4
>> =========
>> SASS:
>> #admin .tabbar a {font-weight: bold}
>> #demo .overview .fakelink {@extend a}
>>
>> CSS:
>> @matches $link a;
>> #admin .tabbar $link {font-weight: bold}
>> @matches $link #demo .overview .fakelink;
>>
>> Equivalent Vanilla:
>> #admin .tabbar a,
>> :matches(#admin .tabbar .fakelink):matches(#demo .overview .fakelink) {
>>   font-weight: bold;
>> }
>
> Is the SASS/vanilla right in example 4?  If so, can someone explain that?  I
> get David's in that example, but how you go from the SASS to that I am
> having trouble following.  Feel free to reply offlist if you think it is
> irrelevant...just wanted to record my confusion and get a correction if
> necessay.

The vanilla is right, it just involves a more powerful variant of
:matches() than currently exists in Selectors, where it accepts
complex selectors.

Given "A B $C {...} @extend $C X Y Z;", you match Z elements which
both have "A B" and "X Y" as ancestors.

~TJ
Received on Thursday, 16 August 2012 07:54:24 GMT

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