Re: Extending Class Proposal

Behrang, thanks for taking the time to read the proposal and respond. I
have a few comments that I'd love to hear your thoughts on.

... I like the idea of having built-in class extension in CSS similar to
> SASS very much but I personally didn't like the syntax.
>

Is there anything in particular you don't like? I'd appreciate any
specifics you could give.


> Also being able to extend "rules" rather than classes might be even better.
>

I actually wasn't proposing extending classes, I think that will lead to
unexpected specificity issues (as I discuss in the article). I was
proposing defining a new abstract class selector and being able to extend
that.

Also, I think the most compelling argument in favor of a new type of
selector (the abstract class selector) is being able to use it in
JavaScript. This will allow authors to not have to put base classes in the
HTML.

For example:
document.querySelectorAll("%button");

This would be used to select all elements that have classes that extend the
button abstract class. This would be very powerful, but it wouldn't be
possible if you were just extending rules as you've suggested.

Received on Wednesday, 30 January 2013 23:35:51 UTC