Skip to content

Commit

Permalink
chore: use variant for font family override
Browse files Browse the repository at this point in the history
  • Loading branch information
nhsz committed Dec 30, 2021
1 parent 71c7d73 commit 4681d22
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/UI/headings/PageSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const PageSection: FC<HeadingProps> = ({ children, ...props }) => {
fontSize='22px'
fontWeight={700}
lineHeight='29px'
className='maison-neue-mono'
textAlign='center'
variant='page-section'
{...props}
>
{children}
Expand Down
4 changes: 0 additions & 4 deletions src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@
url('./public/fonts/MaisonNeueMono-Bold.woff2') format('woff2'),
url('./public/fonts/MaisonNeueMono-Bold.woff') format('woff');
}

.maison-neue-mono {
font-family: 'Maison Neue Mono' !important;
}
1 change: 1 addition & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ChakraProvider } from '@chakra-ui/react';
import '@fontsource/libre-franklin/200.css';
import '@fontsource/libre-franklin/300.css';
import '@fontsource/libre-franklin/400.css';
import '@fontsource/libre-franklin/700.css';
import type { AppProps } from 'next/app';
import '../global.css';
import theme from '../theme';
Expand Down
10 changes: 10 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ export default extendTheme({
fontSizes: {
h1: '40px',
h2: '24px',
h4: '18px',
paragraph: '15px'
},
sizes: {
container: {
mobile: '450px'
}
},
components: {
Heading: {
variants: {
'page-section': {
fontFamily: `Maison Neue Mono, ${base.fonts?.heading}`
}
}
}
}
});

0 comments on commit 4681d22

Please sign in to comment.