Skip to content

Commit 9ad1848

Browse files
committed
feat(text): migrate to semantic colors
1 parent f6d79f6 commit 9ad1848

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/Text/Text.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { theme } from '../../essentials/theme';
1717
import { get } from '../../utils/themeGet';
1818
import { deprecatedProperty } from '../../utils/deprecatedProperty';
19+
import { getSemanticValue } from '../../utils/cssVariables';
1920

2021
interface TextProps
2122
extends ComponentPropsWithoutRef<'span'>,
@@ -54,18 +55,18 @@ function determineTextColor(props: TextProps) {
5455
}
5556

5657
if (disabled) {
57-
return get(inverted ? 'semanticColors.text.disabledInverted' : 'semanticColors.text.disabled')(props);
58+
return getSemanticValue(inverted ? 'text-disabledInverted' : 'text-disabled');
5859
}
5960

6061
if (secondary || weak) {
61-
return get(inverted ? 'semanticColors.text.secondaryInverted' : 'semanticColors.text.secondary')(props);
62+
return getSemanticValue(inverted ? 'text-secondaryInverted' : 'text-secondary');
6263
}
6364

6465
if (inverted) {
65-
return get('semanticColors.text.primaryInverted')(props);
66+
return getSemanticValue('text-primaryInverted');
6667
}
6768

68-
return get('semanticColors.text.primary')(props);
69+
return getSemanticValue('text-primary');
6970
}
7071

7172
const Text = styled.span.attrs({ theme })<TextProps>`

0 commit comments

Comments
 (0)