docs(Icon): storybook demo for theming the icon size scale - #5465
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
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.
Icon size is already themeable —
defineThemecomponent overrides land in@layer astryx-theme, above StyleX — but nothing showed it, so the question "can Icon size be a theme property?" had no answer you could look at. This adds one.What
A
Core/Icon/Size Themingstory with two views, each rendering the same content under three themes side by side (default 12/16/20/24, a compact 10/12/14/16, a spacious 16/22/28/36):icon="search") and an SVG component (icon={BellIcon}).<Icon size="sm">, so onesize:smrule retunes them together.The story docs carry the copy-pasteable
defineThemesnippet and the one non-obvious rule: setfontSizealongsidewidth/height, because registry icons are 1em-based SVGs inside a span — the box alone resizes the span and not the glyph.Risk
None. A new story file; no component, token, or theme change.
Testing
Measured in Chromium against local Storybook. Rendered box per theme matches the declared scale exactly:
Both icon modes agree, and the four in-component glyphs measure 16 / 12 / 22px under the three themes.