fix: extend colorOperand to cover all relative-color channel letters#4435
Closed
fix: extend colorOperand to cover all relative-color channel letters#4435
colorOperand to cover all relative-color channel letters#4435Conversation
Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> Agent-Logs-Url: https://github.com/less/less.js/sessions/4d1ac45c-4305-43e1-962f-991415b969e0
…(a, w) Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> Agent-Logs-Url: https://github.com/less/less.js/sessions/4d1ac45c-4305-43e1-962f-991415b969e0
Copilot
AI
changed the title
[WIP] Improve clarity and consistency in documentation
fix: correct Mar 24, 2026
colorOperand parser for relative color channel keywords
Co-authored-by: matthew-dean <414752+matthew-dean@users.noreply.github.com> Agent-Logs-Url: https://github.com/less/less.js/sessions/08abb38c-787e-402a-b782-6b9c55d5f943
Copilot
AI
changed the title
fix: correct
fix: extend Mar 24, 2026
colorOperand parser for relative color channel keywordscolorOperand to cover all relative-color channel letters
Copilot stopped work on behalf of
matthew-dean due to an error
March 24, 2026 22:37
Copilot stopped work on behalf of
matthew-dean due to an error
March 24, 2026 22:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
colorOperandhad two bugs corruptingcalc()expressions inside relative color syntax (rgb(from …),lab(from …), etc.).Bug 1 — whitespace consumption dropped operators
/^[lchrgbs]\s+/consumed the trailing space as part of the match. When a channel keyword appeared as the right-hand operand (e.g.calc(100 - r)), the parser swallowed the-operator silently:Fixed with a lookahead (
(?=\s|[,/*)]|$)) and returning the captured letter (match[1]) rather than the full match.Bug 2 — character class missing
aandw[lchrgbs]only covered RGB / HSL / LCH / OKLCH channels.a(Lab/OKLab) andw(HWB whiteness) were absent, causing identical parse failures:Full single-letter channel set across all CSS relative color functions —
r g b(rgb),h s l(hsl),h w b(hwb),l a b(lab/oklab),l c h(lch/oklch) — unique:[abcghlrsw].Tests
Added regression cases in
modern.less/modern.cssfor both bugs:calc(100 - r),calc(r + 100),calc(a ± n)inlab(), andcalc(w ± n)inhwb().Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com//usr/bin/gh gh auth login --with-token --hostname github.com(http block)https://api.github.com/graphql/usr/bin/gh gh auth status(http block)https://api.github.com/repos/less/less.js/pulls/4435/usr/bin/curl curl -s -X PATCH -H Authorization: token ****** -H Accept: application/vnd.github+json REDACTED -d {"state":"closed"}(http block)/usr/bin/curl curl -v -X PATCH -H Authorization: token ****** -H Accept: application/vnd.github+json REDACTED -d {"state":"closed"}(http block)/usr/bin/curl curl -s -H Authorization: ****** -H Accept: application/vnd.github+json REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.