Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
nmn
added this pull request to stack #1871
September 10, 2026 01:49
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
nmn
force-pushed
the
feat/enum-condition-negation
branch
from
September 10, 2026 02:01
9f282fc to
1ed5fb9
Compare
nmn
force-pushed
the
feat/enum-condition-negation
branch
from
September 10, 2026 09:57
1ed5fb9 to
6dd777a
Compare
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.
Adds the enum-specific condition logic that #1870 uses for conditional assignments. This PR adds the planner and its tests; the public conditional-call API is connected in the next PR.
For an enum with
comfortable,compact, andspaciousstates, the next PR enables this call:Hover and active can both match. Ordinary styles can let two rules compete over
color; an enum writes a different custom property for each state. Simply activating compact and spacious in separate rules would leave both states active.The planner therefore excludes active from the compact branch. This is the planned CSS structure, using readable names for the classes and state variables:
With hover alone, compact is selected. While pressed, spacious is selected even if hover also matches. With neither condition, comfortable remains selected.
initialactivates a state; the empty value deactivates it.The default is set unconditionally, and matching branches explicitly clear it. Container branches also clear earlier states when they match, so an element with no eligible container keeps its default.
Nested conditions are excluded as a whole. If spacious requires both active and a wide viewport, compact remains available while hovering on a narrow viewport. Branches that select the same state do not need exclusions from one another.
Ordinary styles keep the simpler output from #1867. This stronger negation is isolated to enum assignments, where multiple active custom properties would otherwise break
stylex.match.Validated with selector snapshots, all combinations of hover/active/focus, container fallback cases, and the existing ordinary-style snapshots across 1,025 Babel tests.
PR 5 of 6. Builds on #1868. Next: #1870.