Skip to content

Fix panic when generating color fallbacks for gradients using currentColor - #1311

Open
chuganzy wants to merge 1 commit into
parcel-bundler:masterfrom
chuganzy:fix-color-fallback
Open

Fix panic when generating color fallbacks for gradients using currentColor#1311
chuganzy wants to merge 1 commit into
parcel-bundler:masterfrom
chuganzy:fix-color-fallback

Conversation

@chuganzy

@chuganzy chuganzy commented Aug 20, 2026

Copy link
Copy Markdown

This PR aims to fix a crash when generating color fallbacks for CSS such as:

.foo {
  background-image:
    linear-gradient(oklch(0% 0 0), oklch(100% 0 0)),
    linear-gradient(currentcolor, currentcolor);
}

When targeting a browser without oklch() support, Lightning CSS generates fallbacks for every gradient in the declaration. This caused it to attempt converting currentColor to RGB, P3, or Lab and panic.

Found the same issue in text-shadow. Making a separate PR for that.

@chuganzy
chuganzy force-pushed the fix-color-fallback branch from 0165d76 to e2ecd33 Compare August 20, 2026 15:19
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.

1 participant