You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When guards were added to Less, CSS did not use an "or" operator (that is: the word or), so the closest parallel was the use of the comma in @media queries.
Now that @supports has been added, it mostly follows the syntax of @media but for whatever reason, W3C went with an explicit "or" instead of a comma.
So, to allow some flexibility and maybe make new devs a little happier, I suggest we allow either a comma or the or keyword in guards.
// equal
.mixin (@a) when (@a > 10), (@a < -10) { ... }
.mixin (@a) when (@a > 10) or (@a < -10) { ... }
I can't imagine this is a controversial change, especially given the added syntax in CSS. But, might as well put it out there before making a PR.
Oh, and if/when implemented, it would make sense to me to substitute "or" in the documentation for mixin examples, and just note that a comma can be used like @media.
Activity
seven-phases-max commentedon Oct 1, 2015
+1
SomMeri commentedon Oct 1, 2015
+1
Plus, ability to use
orinside parentheseswhen ((cond1) or (cond2)) and (@a < -10)would be great too.matthew-dean commentedon Oct 1, 2015
@SomMeri That seems reasonable too.
matthew-dean commentedon Oct 1, 2015
I'll mark as ready for implementation. If someone figures out a strong objection, we can change it.
lukeapage commentedon Oct 2, 2015
+1
SomMeri commentedon Dec 16, 2015
@matthew-dean Are you working on this or want to work on this?
matthew-dean commentedon Dec 16, 2015
@SomMeri I don't have time for it currently. Should be a small change.