Skip to content

Commit

Permalink
Merge pull request #5 from LikeLion-KNU/feature/font-weight
Browse files Browse the repository at this point in the history
  • Loading branch information
toothlessdev authored Aug 29, 2024
2 parents 5ddfee5 + 6170a27 commit 84cfb6e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/typography/Text.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { TextProps } from "./Text";
import styled from "@emotion/styled";

export const TextElement = styled.span<TextProps>`
font-weight: ${(props) => props.weight ?? "normal"};
font-size: ${(props) => {
switch (props.size) {
case "xs":
Expand Down Expand Up @@ -35,8 +33,10 @@ export const TextElement = styled.span<TextProps>`
return "var(--font-weight-extrabold)";
case "heavy":
return "var(--font-weight-heavy)";
default:
case undefined:
return "var(--font-weight-regular)";
default:
return props.weight;
}
}};
Expand Down
2 changes: 1 addition & 1 deletion src/components/typography/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const GlobalStyle = css`
a {
text-decoration: none;
}
:root {
--font-size-xl: 24px;
--font-size-l: 22px;
Expand Down

0 comments on commit 84cfb6e

Please sign in to comment.