-
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
Feature request: 'or' combinator #1154
Comments
Your examples don't quite make sense. The In any case, this should be covered by two different approaches in LESS. For one, you can use the
Secondly, the upcoming :extend syntax should cover some other patterns / joins. Because of that, I'd say probably this doesn't add much value. |
will result in:
not:
However, if it did, that would be a good solution. |
Dude, you are misunderstooding how Less works :D |
Being able to break out of the current scope has come up before, so its a |
Oh, right, I forgot that a comma created another combinator. In THAT case, how about this incredibly awesomely ugly hack? ;-)
|
But, yes, to echo @agatronic, in terms of syntax, a lot of people suggest programming-like syntax or patterns, especially JavaScript, but even though the parser is in JavaScript, the patterns and syntax of LESS are derived from and should match CSS as much as possible. Based on the incredible hackishness of my solution, it does leave it open for debate, but your examples do still feel a bit weird to me. I think the only thing "&" really failed to do was append everything that followed, including the comma. Instead, it just operates on that selector, and the comma creates a new combination. |
@agatronic What would be better than the pipe? @MatthewDL I made the double-pipe example to match use of the ampersand. The example with the single pipe is really what I'm looking for. |
double pipe doesn't make sense to me. Closing this and would like to include this feature set in the fix for #1075, taking either of @MatthewDL's suggestions of Please comment on that bug if you'd like |
In addition to the & combinator, an 'or' combinator would be very useful.
for example:
would compile to:
The text was updated successfully, but these errors were encountered: