Skip to content

Test(CSS): Pin support for all CSS color functions in variables - #424

Merged
1aron merged 1 commit into
master-co:rcfrom
0Miles:feat/346-color-function-variables
May 3, 2026
Merged

1aron merged 1 commit into
master-co:rcfrom
0Miles:feat/346-color-function-variables

Conversation

@0Miles

@0Miles 0Miles commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Closes #346.

Summary

Issue asked variables to support all CSS color functions (lab/lch/oklch/etc). The engine already does — `core.ts:resolveVariables` parses any function name matching the color-function regex (`color | color-contrast | color-mix | hwb | lab | lch | oklab | oklch | rgb | hsl | light-dark`) into a typed color variable with proper space and alpha. This PR pins that contract with regression tests so it can't drift silently.

Changes

  • New `tests/issue-346-color-funcs.test.ts` — 12 cases covering rgb / hsl / hwb / lab / lch / oklab / oklch / color() with srgb, display-p3, rec2020 + alpha alias propagation across an oklch variable + color-mix preservation

No source code changes — verify-and-pin commit.

Testing

12/12 tests pass. Real Chrome verification: `bg:primary` with `color.primary: 'oklch(0.5 0.15 240)'` produces `backgroundColor: "oklch(0.5 0.15 240)"` at runtime.

@vercel

vercel Bot commented Apr 30, 2026

Copy link
Copy Markdown

@0Miles is attempting to deploy a commit to the Aoyue Team on Vercel.

A member of the Team first needs to authorize it.

Issue asked variables to support all CSS color functions
(lab/lch/oklch/etc). The engine already does — core.ts:resolveVariables
parses any function name matching the color-function regex (color,
color-contrast, color-mix, hwb, lab, lch, oklab, oklch, rgb, hsl,
light-dark) into a typed color variable with proper space and alpha.

This commit pins that contract with regression tests. No source
changes.

- 12 test cases: rgb, hsl, hwb, lab, lch, oklab, oklch, color() with
  srgb / display-p3 / rec2020, alpha alias propagation across an
  oklch variable, color-mix preservation
- Real Chrome verification: bg:primary with
  color.primary: 'oklch(0.5 0.15 240)' produces oklch backgroundColor
  at runtime

Closes master-co#346
@0Miles
0Miles force-pushed the feat/346-color-function-variables branch from 08211f5 to 4562f58 Compare April 30, 2026 19:04
@1aron
1aron merged commit 22152d4 into master-co:rc May 3, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Variables support all color functions

2 participants