Repository navigation
Conversation
…ment
Style props are written as inline custom properties (--ps-width, --ps-width-md, …)
and read by .ps-<prop> utility rules. Custom properties inherit, so an element
that did not set a given variable read its ancestor's value instead of the
documented fallback:
<Box width={200}><Stack width={{ md: 400 }} /></Box> -> inner 200px below md (expected auto)
<Stack width={{ md: 300 }}><Stack width={200} /></Stack> -> inner 300px at md (expected 200px)
Declare the six variables as `initial` in each of the 20 base rules in
layout.css / spacing.css. `initial` is the guaranteed-invalid value, so var()
falls through to its fallback; inline values on the element still win.
@Property { inherits: false } was rejected (unsupported in Firefox < 128).
Add layout.css.test.ts / spacing.css.test.ts, deriving the prop list from the TS
registries so a future prop without matching CSS fails CI.
gzip: layout.css 1206 -> 1631 B (+425), spacing.css 948 -> 1192 B (+244).
Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Contributor
Author
|
Double checked with Ladle story above that #398 resolves the issue. Closing this PR. |
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.
Description
Fixes a cascade bug in the
@perses-dev/components/nextstyle-prop engine: an element could silently pick up anancestor's style-prop value instead of its own documented fallback.
Screenshots
Before
After
Before
After
Ladle Story
https://gist.github.com/zhuje/5c2a2d41669108dfb2941994dba682c6
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: