Re: Extending Class Proposal

>
> 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 UTC