-
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
Restrictions on namespaces and mixins names #1205
Comments
probably another case of incomplete code that has not caused a problem - just an inconsistancy
none match this either
but this does match
so it has nothing to do with ampersand support. that looks v. suspicious to me
|
Thank you for detailed answer. I do not like one particular aspect of 1. It was surprising to find out that these two are equivalent:
It was very unexpected, at least for me, that this call:
matches this:
These two being equivalent is perfectly nice and concise
What bothers me is this one:
|
I think that optional space between namespace and mixin would be ok, it less would not allow extended mixin names. But it does allow them (point 2) and they are nice feature I think. It has both extended mixin names and optional space, so there is no way to distinguish between these two mixins: Mixin 1:
Mixin 2:
|
Another observation: only mixins names can contain combiner, namespaces can not. Following does not work:
It is ok I guess, but I wanted to collect the whole behavior on one place so it can be easily documented later on. |
To keep things up-to-date, the above patch fixes the following examples here:
|
I wonder if we actually consider (1) and (2) as a bug. It's just a historical Less feature and I see no way to "fix" it w/o major breaking changes. (3) is an intended behaviour. Thus considering (4) is fixed this issue has some chances to be closed :) |
@seven-phases-max You are mostly right, but the property described in this comment is still bothering me. If we think we can not change it due to backward compatibility, then so be it. But if we can, I would like to fix it. |
I'd rather put it in a way of "do we really need to change it?". The trick is that when we actually use this syntax to invoke So I'd say that while with no doubt this remains an issue and definitely looks like a significant one in theory, in practice it turns out to be no more than just a tiny bogus :) But regardless of above now I think you're right and we're better to keep it open (maybe I would just decrease its priority), in fact I would love to see ideas of possible solutions (because I suspect that an attempt to fix this in an " |
What I took from what you wrote is that (nothing) is just multiple classes css combinator, just like I can buy the above view of things. I was thinking about it in terms of how less looks like and current behavior made little sense, now it makes sense to me. So, now I think it might be better to close this, unless we can clearly state what the problem is. |
:) Interesting, for me it always looked like I do the opposite unless implementation details and backward compatibiity dictate something too hard (that's what |
What is officially acceptable namespace/mixin name? I'm asking because I could not come up with consistent set of rules. I made some observations, but I'm not sure what is how it is supposed to, what is incidental be behavior and whether something is a bug.
The most suspicious point is 4b.
1.) The distribution of
and
>
in mixin call does not seem to matter. All following mixin calls seems to match exactly same set of mixins:.amp.ext.support;
.amp .ext.support;
.amp.ext .support;
.amp .ext .support;
.amp > .ext.support;
.amp.ext > .support;
.amp > .ext > .support;
2.) Mixins name can be composed of multiple classes/ids. Selector combinators and ampersands between classes/ids does not matter. All above mixin calls match all these declarations:
3.) Spaces inside names does matter, this will not be matched:
4a.) Extensions of namespaces names are ignored. Neither of these will be matched:
4b.) Extensions of namespaces names are ignored. Both of these will be matched by all above mixin calls:
I placed the whole case into a gist.
The text was updated successfully, but these errors were encountered: