Skip to content

Commit

Permalink
fix text story
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Sep 21, 2023
1 parent c9b8ac3 commit 3b8c9a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/content/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const getTextColor = (color: TextColor) => {
if (textColor) {
return textColor;
}
if (color.startsWith('text-')) {
const [, num] = color.split('-');
return `var(--ac-global-text-color-${num})`;
}
return colorValue(color as ColorValue);
};

Expand Down
4 changes: 4 additions & 0 deletions src/content/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export type TextColor =
| 'white90'
| 'white70'
| 'white30'
// non-static colors
| 'text-900'
| 'text-700'
| 'text-300'
| 'inherit'
| DesignationColorValue
| ColorValue;
Expand Down
6 changes: 3 additions & 3 deletions stories/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const sizes: TextProps['textSize'][] = [
];

const colors: TextProps['color'][] = [
'white30',
'white70',
'white90',
'text-900',
'text-700',
'text-300',
'designationPurple',
'designationTurquoise',
'success',
Expand Down

0 comments on commit 3b8c9a0

Please sign in to comment.