Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
fix:setting default text color for shadows bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Jan 23, 2024
1 parent 68504fb commit 5abc7de
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface Props<C extends React.ElementType> {
/**
* The children or content of the Text component
*/
children?: React.ReactChild;
children?: React.ReactNode;
/**
* Polymorphic prop to change the html root element of the component
*/
Expand All @@ -14,6 +14,10 @@ interface Props<C extends React.ElementType> {
* The style prop of the Text component
*/
style?: object;
/**
* The color prop of the Text component
*/
color?: string;
}

type TextProps<C extends React.ElementType> = Props<C> &
Expand All @@ -23,10 +27,17 @@ export const Text = <C extends React.ElementType = 'span'>({
style,
children,
as,
color,
}: TextProps<C>) => {
const Component = as || 'span';
return (
<Component style={{ fontFamily: fontFamilies.euclidCircularB, ...style }}>
<Component
style={{
fontFamily: fontFamilies.euclidCircularB,
color: 'var(--color-text-default)',
...style,
}}
>
{children}
</Component>
);
Expand Down

0 comments on commit 5abc7de

Please sign in to comment.