Repository navigation
Conversation
|
View your CI Pipeline Execution ↗ for commit 6bf661c
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
Color reads `oklch()`, `oklab()`, `lab()`, `lch()`, `hwb()`, `color()` and relative colors (`oklch(from var(--x) calc(l * .9) c h)`) with @csstools/css-color-parser, which core already uses for `color-mix()`. Tailwind v4 and Bootstrap 6 define their whole palettes in oklch, which threw "Invalid color". The modern `rgb()`/`hsl()` syntax the fast path misread now goes the same way: a `/` alpha given as a percentage (`rgb(0 0 0 / 15%)` came out opaque), rgb percentages, and `none`. The legacy syntax keeps the fast path. The value parser behind `background` and gradients recognises the new functions too, and nested ones such as `color-mix(in srgb, rgb(0 0 0), red)`. `Color.isValid()` accepts them.
triniwiz
force-pushed
the
feat/css-color-functions
branch
from
October 15, 2026 13:38
0d6afca to
c82a72b
Compare
This branch has not been deployed
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.
PR Checklist
What is the current behavior?
Colorthrows "Invalid color" foroklch(),oklab(),lab(),lch(),hwb(),color()and relative colors (oklch(from var(--x) calc(l * .9) c h)). Tailwind v4 and Bootstrap 6 define their whole palettes inoklch().rgb()/hsl()syntax: a percentage alpha (rgb(0 0 0 / 15%)comes out opaque), rgb percentages, andnone.backgroundand gradient stops only recognisesrgb/hsl/hsvwithout nested functions.What is the new behavior?
@csstools/css-color-parser, which core already uses forcolor-mix(). The legacyrgb()/hsl()/hex/name forms keep the existing fast path.parseCssColorrecognises the new functions, and nested ones such ascolor-mix(in srgb, rgb(0 0 0), red), by matching parentheses.Color.isValid()accepts the new functions andcolor-mix().Tests:
color/color.spec.ts(6) and new cases incss/parser.spec.ts.Verified with all of these core PRs merged together (#11527–#11537):
apps/automatedpasses on the iOS 26.4 simulator (1830 OK, 0 failed) and on an Android API 36 emulator (1692 OK; the one failure is the network-dependentIMAGE-CACHE.test_ImageCache_ValidUrltimeout, which also passes on reruns).