W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: Extending Class Proposal

From: Philip Walton <philip@philipwalton.com>
Date: Thu, 31 Jan 2013 11:36:20 -0800
Message-ID: <CAGRhNhU2nv33duM+Sv8zsQS=_tbYrTbg4H50gvGg3ZAXi16s-A@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
>
> That has nothing to do with SASS's syntax, and everything to do with
> the fact that SASS is a preprocessor, not a part of the browser.
>
> In SASS's @extend existed in the browser, it would apply to all
> selector matching, including that done via JS.


Yes, obviously, so let me rephrase: assuming Sass syntax were currently
implemented by the browser, how would you target all instances of a base
class with JavaScript?

The only way I could see with the current syntax would be
document.querySelectorAll(".button"), which would match all elements with
the button class as well as all elements that match any extending selector.
But this seems like a really bad solution because there are certainly
situations where you'd want to *just* match the base class. It would also
be inconsistent with CSS selectors which currently don't match extended
classes.

If I'm misrepresenting your idea, please clarify how you'd expect
JavaScript to target all instances of a base class.
Received on Thursday, 31 January 2013 19:36:51 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT