Repository navigation
fix(colors): sync variants for RAW variable references - #47
Open
Jan-CoreBunch wants to merge 2 commits into
Open
Jan-CoreBunch wants to merge 2 commits into
Jan-CoreBunch wants to merge 2 commits into
Conversation
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.
What
RAW colors that reference another color, such as
--light: var(--bg-body), now generate transparencies, shades and tints from the current source value. Changing a shade/tint count updates the generated swatches and stored count together, and changing the referenced color refreshes automatic swatches while retaining manual edits.For example, after changing
--bg-bodyfrom purple to pink,--light-80and automatic--light-d-*/--light-l-*variants now follow pink instead of retaining purple.Why
Transparency generation read a global variable snapshot populated by Preview CSS, which could be missing or stale. Shade/tint generation also received unresolved
var(...)values; an empty generation result left old swatches in place while storing a zero count, separate from the counter shown in the UI.The shared generator and WordPress/Figma-to-WordPress synchronization now receive the current preset variables directly. The editor subscribes to source-color changes, and the counters use the stored color state.
Compatibility and saved colors
isCustommetadata to shade/tint entries. Manual edits remain fixed; Reset returns a swatch to automatic generation.CI dependency compatibility
The critical dependency audit also blocked this branch before compilation. Match the existing fixes in #45 and #46 by pinning
proxy-addrto2.0.8andshell-quoteto1.11.0, and pinhandlebarsto4.7.10for the additional findings now reported through ts-jest (Handlebars advisory, second Handlebars advisory). These are build/test dependencies; the audit threshold is unchanged.Only those three dependency resolutions change. Regenerating the lockfile also aligns workspace metadata with the existing
2.0.2package manifests. Identical dependency pins can merge with the other fixes; this PR does not require either product fix.Verification
bun run test:www: 27 suites / 186 tests passed, including existing default/prefixed CSS expectations.APP_ENV=productionin the process environment to preserve the local development configuration.bun audit --audit-level=criticalpasses, all 186 web/shared-core tests pass, and the Figma and Gutenberg blocks builds pass.git diff --checkpassed.The normal boundary scan hits the existing Windows separator mismatch in the allowlist for
packages/wp/wp/Config/Setup.php. All source and built-output checks passed with separators normalized in memory; the scanner and allowlist are unchanged.Docker was not running, so the disposable WordPress end-to-end harness was not run locally. The full GitHub CI run passed at commit
b2ca84c, including the critical dependency audit, all builds and typechecks, web tests, PHP tests, and WordPress E2E. Bricks/Oxygen builder UI and Figma Desktop save flows were not rerun for this change.Reproduction / review
--bg-bodyto a literal color and--lightto RAWvar(--bg-body).--light; change the shade count from 4 to 7 while keeping 4 tints.--bg-bodyand check that automatic variants follow it and--light-80uses the new color.