Skip to content

Commit

Permalink
style(text): prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
hackr-sh committed May 9, 2023
1 parent 0c8b42a commit 3e45a78
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/components/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,40 @@ export const Text = (props: TextProps) => {
return <TextElement as={variant} {...props} />;
};


const variantMapping = {
h1: {
fontSize: "2em",
fontWeight: 700
fontWeight: 700,
},
h2: {
fontSize: "1.5em",
fontWeight: 600
fontWeight: 600,
},
h3: {
fontSize: "1.17em",
fontWeight: 600
fontWeight: 600,
},
h4: {
fontSize: "1em",
fontWeight: 500
fontWeight: 500,
},
h5: {
fontSize: "0.83em",
fontWeight: 500
fontWeight: 500,
},
h6: {
fontSize: "0.67em",
fontWeight: 500
fontWeight: 500,
},
p: {
fontSize: "1em",
fontWeight: 400
}
fontWeight: 400,
},
};

const TextElement = styled.p<TextProps>`
font-family: "Poppins", sans-serif;
font-weight: ${(props) => variantMapping[props.variant ?? "p"].fontWeight};
font-size: ${(props) => variantMapping[props.variant ?? "p"].fontSize};
color: ${(props) => props.theme.text};
`;
font-family: "Poppins", sans-serif;
font-weight: ${(props) => variantMapping[props.variant ?? "p"].fontWeight};
font-size: ${(props) => variantMapping[props.variant ?? "p"].fontSize};
color: ${(props) => props.theme.text};
`;

0 comments on commit 3e45a78

Please sign in to comment.