Fiddle: more fixes for stack and box#248
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes inheritance issues with responsive sizing properties in Box and Stack components by using CSS @property declarations with inherits: false. This prevents child components from unintentionally inheriting responsive sizing variables from parent components.
Changes:
- Added
@propertydeclarations to Box and Stack styles to prevent CSS variable inheritance - Removed
shouldResetInheritanceparameter fromresponsiveValueToCssutility function - Changed approach from setting CSS variables to 'initial' to only setting them when defined
- Updated default fallback values in Box component from
undefinedto'auto'
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/util/responsiveUtil.ts | Removed shouldResetInheritance parameter and changed to only set defined responsive values |
| src/particles/box/styles.scss | Added @property declarations with inherits: false for all Box CSS variables; removed hardcoded defaults from fallback chains |
| src/particles/box/component.tsx | Changed default values from undefined to 'auto'; removed 'initial' fallbacks when setting CSS variables |
| src/layouts/stack/styles.scss | Added @property declarations with inherits: false for all Stack CSS variables |
| src/layouts/stack/component.tsx | Removed shouldResetInheritance parameter; changed to conditionally set max/min CSS variables only when responsive props exist |
| src/layouts/grid/component.tsx | Changed from setting undefined responsive variables to 'initial' to conditionally setting them only when defined |
| CHANGELOG.md | Updated to describe the fixes |
Comment on lines
+13
to
+42
| @property --kiba-box-width { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-width-sm { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-width-md { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-width-lg { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-width-xl { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-height { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-height-sm { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-height-md { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-height-lg { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-height-xl { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-width { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-width-sm { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-width-md { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-width-lg { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-width-xl { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-height { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-height-sm { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-height-md { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-height-lg { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-max-height-xl { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-width { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-width-sm { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-width-md { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-width-lg { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-width-xl { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-height { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-height-sm { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-height-md { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-height-lg { syntax: "*"; inherits: false; } | ||
| @property --kiba-box-min-height-xl { syntax: "*"; inherits: false; } |
There was a problem hiding this comment.
Inconsistent naming convention between Box and Stack components. Box uses -sm, -md, -lg, -xl suffixes for responsive breakpoints, while Stack uses -small, -medium, -large, -extraLarge. This inconsistency could lead to confusion. Consider standardizing on one naming convention across all components.
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
Screenshots:
Checklist: