-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR updates typography components: - [adds](https://chakra-ui.com/community/recipes/using-fonts#option-2-using-font-face) `Segment` font - sets the correct styles based on the [designs](https://www.figma.com/file/OUdSfHsmgV8EJpWxAzXjl5/Design-Tasks?node-id=2251%3A20910&mode=dev) - creates a directory for the shared components
- Loading branch information
Showing
14 changed files
with
152 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from "react" | ||
import { Global } from "@emotion/react" | ||
|
||
import SegmentRegular from "../../fonts/Segment-Regular.otf" | ||
import SegmentMedium from "../../fonts/Segment-Medium.otf" | ||
import SegmentSemiBold from "../../fonts/Segment-SemiBold.otf" | ||
import SegmentBold from "../../fonts/Segment-Bold.otf" | ||
import SegmentBlack from "../../fonts/Segment-Black.otf" | ||
|
||
export default function GlobalStyles() { | ||
return ( | ||
<Global | ||
styles={` | ||
@font-face { | ||
font-family: "Segment"; | ||
src: url(${SegmentRegular}) format("opentype"); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Segment"; | ||
src: url(${SegmentMedium}) format("opentype"); | ||
font-weight: 500; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Segment"; | ||
src: url(${SegmentSemiBold}) format("opentype"); | ||
font-weight: 600; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Segment"; | ||
src: url(${SegmentBold}) format("opentype"); | ||
font-weight: 700; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: "Segment"; | ||
src: url(${SegmentBlack}) format("opentype"); | ||
font-weight: 900; | ||
font-style: normal; | ||
} | ||
`} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from "react" | ||
import { Heading, HeadingProps, Text, TextProps } from "@chakra-ui/react" | ||
|
||
export function H1(props: HeadingProps) { | ||
return <Heading as="h1" size={{ base: "6xl", md: "7xl" }} {...props} /> | ||
} | ||
|
||
export function H2(props: HeadingProps) { | ||
return <Heading as="h2" size={{ base: "5xl", md: "6xl" }} {...props} /> | ||
} | ||
|
||
export function H3(props: HeadingProps) { | ||
return <Heading as="h3" size={{ base: "4xl", md: "5xl" }} {...props} /> | ||
} | ||
|
||
export function H4(props: HeadingProps) { | ||
return <Heading as="h4" size={{ base: "3xl", md: "4xl" }} {...props} /> | ||
} | ||
|
||
export function H5(props: HeadingProps) { | ||
return <Heading as="h5" size={{ base: "2xl", md: "3xl" }} {...props} /> | ||
} | ||
|
||
export function H6(props: HeadingProps) { | ||
return <Heading as="h6" size={{ base: "xl", md: "2xl" }} {...props} /> | ||
} | ||
|
||
export function TextXl(props: TextProps) { | ||
return ( | ||
<Text as="p" fontWeight="medium" fontSize="xl" lineHeight="xl" {...props} /> | ||
) | ||
} | ||
|
||
export function TextLg(props: TextProps) { | ||
return ( | ||
<Text as="p" fontWeight="medium" fontSize="lg" lineHeight="lg" {...props} /> | ||
) | ||
} | ||
|
||
export function TextMd(props: TextProps) { | ||
return ( | ||
<Text as="p" fontWeight="medium" fontSize="md" lineHeight="md" {...props} /> | ||
) | ||
} | ||
|
||
export function TextSm(props: TextProps) { | ||
return ( | ||
<Text as="p" fontWeight="medium" fontSize="sm" lineHeight="sm" {...props} /> | ||
) | ||
} | ||
|
||
export function TextXs(props: TextProps) { | ||
return ( | ||
<Text as="p" fontWeight="medium" fontSize="xs" lineHeight="xs" {...props} /> | ||
) | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ComponentSingleStyleConfig } from "@chakra-ui/react" | ||
|
||
const Heading: ComponentSingleStyleConfig = { | ||
sizes: { | ||
"7xl": { | ||
fontSize: "4.5rem", | ||
lineHeight: "5.625rem", | ||
}, | ||
"6xl": { | ||
fontSize: "3.75rem", | ||
lineHeight: "4.5rem", | ||
}, | ||
"5xl": { | ||
fontSize: "3rem", | ||
lineHeight: "3.75rem", | ||
}, | ||
"4xl": { | ||
fontSize: "2.25rem", | ||
lineHeight: "2.75rem", | ||
}, | ||
"3xl": { | ||
fontSize: "1.875rem", | ||
lineHeight: "2.375rem", | ||
}, | ||
"2xl": { | ||
fontSize: "1.5rem", | ||
lineHeight: "2rem", | ||
}, | ||
}, | ||
} | ||
|
||
export default Heading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
export const fontSizes = { | ||
xs: "0.75rem", | ||
sm: "0.875rem", | ||
md: "1rem", | ||
lg: "1.125rem", | ||
xl: "1.25rem", | ||
} | ||
|
||
export const fontWeights = { | ||
medium: 500, | ||
semibold: 600, | ||
bold: 700, | ||
black: 900, | ||
} | ||
|
||
export const lineHeights = { | ||
xs: "1.125rem", | ||
sm: "1.25rem", | ||
md: "1.5rem", | ||
lg: "1.75rem", | ||
xl: "1.875rem", | ||
lg: "1.75rem", | ||
md: "1.5rem", | ||
sm: "1.25rem", | ||
xs: "1.125rem", | ||
} | ||
|
||
export const fonts = { | ||
heading: "Segment, sans-serif", | ||
body: "Segment, sans-serif", | ||
} |