Skip to content

Commit 87a4eae

Browse files
talissoncostaclaude
andcommitted
fix(storybook): fix code tag visibility and palette swatch layout
Fix <code> elements inheriting Storybook/Bootstrap colour overrides that made them invisible in light mode. Fix colour palette swatches wrapping to a second row by using flex layout instead of fixed widths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 50601d1 commit 87a4eae

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

frontend/stories/ColourPalette.stories.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ const SwatchCard: React.FC<{ swatch: Swatch }> = ({ swatch }) => {
5757

5858
return (
5959
<div
60-
style={{ display: 'flex', flexDirection: 'column', gap: 4, width: 72 }}
60+
style={{
61+
display: 'flex',
62+
flex: 1,
63+
flexDirection: 'column',
64+
gap: 4,
65+
minWidth: 0,
66+
}}
6167
>
6268
<div
6369
style={{
@@ -96,7 +102,7 @@ const ScaleRow: React.FC<{ scale: Scale }> = ({ scale }) => (
96102
>
97103
{scale.name}
98104
</h3>
99-
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
105+
<div style={{ display: 'flex', gap: 6 }}>
100106
{scale.swatches.map((s) => (
101107
<SwatchCard key={s.variable} swatch={s} />
102108
))}
@@ -129,8 +135,10 @@ const PalettePage: React.FC = () => {
129135
marginBottom: 24,
130136
}}
131137
>
132-
Auto-generated from <code>web/styles/_primitives.scss</code>. Add a new
133-
variable to the SCSS file and it will appear here automatically.
138+
Auto-generated from{' '}
139+
<code style={{ color: 'inherit' }}>web/styles/_primitives.scss</code>.
140+
Add a new variable to the SCSS file and it will appear here
141+
automatically.
134142
</p>
135143
{scales.map((scale) => (
136144
<ScaleRow key={scale.name} scale={scale} />

frontend/stories/SemanticTokens.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ const TokensPage: React.FC = () => {
210210
}}
211211
>
212212
Auto-generated from CSS custom properties defined in{' '}
213-
<code>web/styles/_tokens.scss</code>. Toggle the theme in the toolbar to
214-
see computed values update.
213+
<code style={{ color: 'inherit' }}>web/styles/_tokens.scss</code>.
214+
Toggle the theme in the toolbar to see computed values update.
215215
</p>
216216
{groups.map((group) => (
217217
<TokenGroupSection key={group.title} group={group} />

0 commit comments

Comments
 (0)