-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extend like sass #1014
Comments
just read http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend the selector merging appears to me quite un-intuitive.. in this example it produces cool output.. does it always? Not sure if it should make 1.4.0 in the same sass way... |
SASS's extend is WAAAY to greedy. This (from the SASS documentation) is terrifying to me:
Why you would ever want extending a partial class which then injects that selector into every instance where that class appears is beyond me. I mean, think about how many instances of "a" there are in a typical web app. That's just pure craziness. But to each their own, I guess. So, for this:
I would expect LESS to do nothing. If you want to extend
|
Agreed with @MatthewDL. If I wanted to extend |
Or not.. we can revisit this later, but it will need some strong usecases I |
Personally, I think that LESS should be a little more explicit. @MatthewDL's SASS example is pretty scary. So, ul.inline li { display: inline-block; }
nav ul { &:extend(.inline); } should do nothing, but ul.inline li { display: inline-block; }
nav ul { &:extend(ul.inline); } should output ul.inline li, nav ul li { display: inline-block; } This, of course, assumes current functionality of |
I've been writing up less behaviour in the context of sass behaviour. I have come to believe they give this functionality because they do not support extending multiple elements, e.g. "ul.inline" so this was a way for them to provide the ability to extend in the above case when you would not otherwise be able to. less is different. |
less 1.4.0 converts:
to:
Notice ulnav ul li selector.
Similar code in sass 3.2.1:
produces
The text was updated successfully, but these errors were encountered: