diff --git a/src/components/typography/Text.style.ts b/src/components/typography/Text.style.ts index d1dd0db..62e7e6e 100644 --- a/src/components/typography/Text.style.ts +++ b/src/components/typography/Text.style.ts @@ -2,8 +2,6 @@ import { TextProps } from "./Text"; import styled from "@emotion/styled"; export const TextElement = styled.span` - font-weight: ${(props) => props.weight ?? "normal"}; - font-size: ${(props) => { switch (props.size) { case "xs": @@ -35,8 +33,10 @@ export const TextElement = styled.span` return "var(--font-weight-extrabold)"; case "heavy": return "var(--font-weight-heavy)"; - default: + case undefined: return "var(--font-weight-regular)"; + default: + return props.weight; } }}; diff --git a/src/components/typography/Text.tsx b/src/components/typography/Text.tsx index 9f8c37c..f15ccb9 100644 --- a/src/components/typography/Text.tsx +++ b/src/components/typography/Text.tsx @@ -5,7 +5,7 @@ import { TextElement } from "./Text.style"; export interface TextProps extends React.ComponentProps<"span"> { size: "xs" | "s" | "m" | "l" | "xl" | string; color?: "primary" | string; - weight?: "light" | "regular" | "bold" | "extrabold" | "heavy"; + weight?: "light" | "regular" | "bold" | "extrabold" | "heavy" | string; children: React.ReactNode; } diff --git a/src/styles/global.ts b/src/styles/global.ts index 80a16d6..668441b 100644 --- a/src/styles/global.ts +++ b/src/styles/global.ts @@ -21,7 +21,7 @@ export const GlobalStyle = css` a { text-decoration: none; } - + :root { --font-size-xl: 24px; --font-size-l: 22px;