less.js
less.js copied to clipboard
fix(issue#4343) add color operands
What:
Add missing color operand support to resolve issue #4343.
Currently the following Less:
background: oklch(from #0000FF calc(l + 0.1) c h);
results in the following error:
Error: Could not parse call arguments or missing ')'
because color components are not being detected as valid operands for an Operation. This PR resolves that issue and also adds tests for oklch, rgb, and hsl.
Why:
Using color components as an operand is valid and should be supported.
Checklist:
- [ ] Documentation
- [x] Added/updated unit tests
- [x] Code complete
Prior comments from https://github.com/less/less.js/pull/4344 :
This looks good. I wonder a bit if Less should actually calculate the final value, since the color is static in this case (not from a var(), but I think actually it's fine how it is.