Skip to content

fix(ui): preserve lightness stops in shared theme URLs - #295

Open
minwookshin wants to merge 1 commit into
adobe:mainfrom
minwookshin:fix/theme-lightness-url
Open

minwookshin wants to merge 1 commit into
adobe:mainfrom
minwookshin:fix/theme-lightness-url

Conversation

@minwookshin

Copy link
Copy Markdown

Description

Fixes #252. Store the authored lightness stops alongside the contrast ratios in shared theme URLs, and restore them when sorting the initial inputs. Previously, reopening 97.5, 95, 90… produced 97.23, 95.15, 89.53… because lightness was reconstructed from quantized output colors.

Motivation

Keep saved input values exact without changing generated colors or the behavior of older URLs. Copy the parsed ratio array before constructing BackgroundColor, which sorts it in place, so unsorted URLs retain the correct lightness/ratio pairing. Invalid saved values fall back to calculated lightness; later ratio edits calculate fresh values normally.

Verified on the production build in Chromium, Firefox and WebKit: repeated round trips, identical output colors, older URLs, reversed stop order, 0/100, invalid/mismatched stop arrays, ratio edits and adding/removing stops. Scoped ESLint and vite build pass; existing unused-import and bundle-size warnings are unchanged.

To-do list

@changeset-bot

changeset-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 01e395b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This branch has not been deployed

No deployments
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.

Lightness values not preserved when reopening URL

1 participant