Skip to content

Commit e720f7e

Browse files
committed
feat: add 'dimmed' as a valid color option for Typography component
1 parent 694266d commit e720f7e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/shared-components/atoms/Typography/Typography.styles.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MantineTheme, MantineSpacing, rem, MantineGradient } from '@mantine/cor
66
export interface TypographyStylesProps {
77
variant: 'h1' | 'h2' | 'h3' | 'body' | 'caption';
88
weight: 'regular' | 'medium' | 'semibold' | 'bold';
9-
color: 'primary' | 'secondary' | 'light' | 'gradient' | 'inherit';
9+
color: 'primary' | 'secondary' | 'light' | 'gradient' | 'inherit' | 'dimmed';
1010
mt?: MantineSpacing | (string & {}) | number; // Updated type
1111
mb?: MantineSpacing | (string & {}) | number; // Updated type
1212
ml?: MantineSpacing | (string & {}) | number; // Updated type
@@ -124,6 +124,13 @@ export const getTypographyStyles = (
124124
color: theme.colors.gray[4],
125125
};
126126
break;
127+
case 'dimmed':
128+
// Set dimmed color that is slightly muted
129+
styles.color = theme.colors.gray[6];
130+
styles['[data-mantine-color-scheme="dark"] &'] = {
131+
color: theme.colors.dark[2],
132+
};
133+
break;
127134
case 'gradient':
128135
// Define gradient using theme tokens
129136
const gradient: MantineGradient = { from: theme.primaryColor, to: 'cyan', deg: 45 }; // Adjust 'cyan' if needed

src/shared-components/atoms/Typography/Typography.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ReactNode, ElementType } from 'react';
22

33
export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'body' | 'caption';
44
export type TypographyWeight = 'regular' | 'medium' | 'semibold' | 'bold';
5-
export type TypographyColor = 'primary' | 'secondary' | 'light' | 'gradient' | 'inherit';
5+
export type TypographyColor = 'primary' | 'secondary' | 'light' | 'gradient' | 'inherit' | 'dimmed';
66

77
export interface TypographyProps {
88
children: ReactNode;

0 commit comments

Comments
 (0)