Skip to content

Commit

Permalink
feat: sets default font to Inter (noodle-run#137)
Browse files Browse the repository at this point in the history
* feat(web): adds inter font

* feat(storybook): adds inter font
  • Loading branch information
ixahmedxi authored Jul 4, 2023
1 parent 1cb6bc3 commit e47de30
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 6 deletions.
19 changes: 13 additions & 6 deletions apps/web/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import '@/styles/globals.css';

import { Provider as WrapBalancerProvider } from 'react-wrap-balancer';
import { Analytics } from '@vercel/analytics/react';
import { SessionProvider } from 'next-auth/react';
import { DefaultSeo } from 'next-seo';
import { ThemeProvider } from 'next-themes';
import { type AppProps } from 'next/app';
import { Inter } from 'next/font/google';

import { type Session } from '@noodle/auth';

import '@/styles/globals.css';

import { SessionProvider } from 'next-auth/react';

import { api } from '@/utils/api';
import { seo } from '@/utils/seo';

const inter = Inter({
subsets: ['latin'],
variable: '--font-inter',
weight: 'variable',
display: 'swap',
});

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface MyAppProps extends AppProps {
pageProps: {
Expand All @@ -22,7 +29,7 @@ interface MyAppProps extends AppProps {

const App = ({ Component, pageProps }: MyAppProps) => {
return (
<>
<div className={`${inter.variable} font-sans`}>
<DefaultSeo {...seo} />
<SessionProvider session={pageProps.session}>
<ThemeProvider attribute="class">
Expand All @@ -32,7 +39,7 @@ const App = ({ Component, pageProps }: MyAppProps) => {
<Analytics />
</ThemeProvider>
</SessionProvider>
</>
</div>
);
};

Expand Down
2 changes: 2 additions & 0 deletions packages/config/storybook/src/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@fontsource-variable/inter';

import { withThemeByClassName } from '@storybook/addon-styling';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { type Preview } from '@storybook/react';
Expand Down
3 changes: 3 additions & 0 deletions packages/config/tailwind/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const config = {
},
},
extend: {
fontFamily: {
sans: ['var(--font-inter)'],
},
colors: {
primary: {
50: '#ff93ad',
Expand Down
4 changes: 4 additions & 0 deletions packages/storybook/.storybook/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@tailwind components;
@tailwind utilities;

:root {
--font-inter: 'Inter Variable', sans-serif;
}

html,
body {
@apply bg-gray-1 dark:bg-graydark-1 text-gray-12 dark:text-graydark-12 h-full;
Expand Down
3 changes: 3 additions & 0 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"storybook": "storybook dev -p 6006",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@fontsource-variable/inter": "^5.0.4"
},
"devDependencies": {
"@noodle/storybook-config": "workspace:^",
"@noodle/tailwind": "workspace:^",
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/.storybook/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@tailwind components;
@tailwind utilities;

:root {
--font-inter: 'Inter Variable', sans-serif;
}

html,
body {
@apply bg-gray-1 dark:bg-graydark-1 text-gray-12 dark:text-graydark-12 h-full;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@fontsource-variable/inter": "^5.0.4",
"clsx": "^1.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e47de30

Please sign in to comment.