Skip to content

Commit

Permalink
Adds support to unify the import of fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecmart committed Nov 4, 2024
1 parent c5c53b6 commit cbc3a3f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/adminpanel/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
LoadInter800
} from 'app/components/next/LoadFont'
import Tamagui from '../tamagui.config'
import { FontsLoader } from 'app/components/FontsLoader'

export default class Document extends NextDocument {
static async getInitialProps({ renderPage }) {
Expand Down Expand Up @@ -58,6 +59,8 @@ export default class Document extends NextDocument {
<meta name="docsearch:language" content="en" />
<meta name="docsearch:version" content="1.0.0,latest" />
{/* <LoadInter100 /> */}
<FontsLoader />

<LoadInter200 />
<LoadInter300 />
<LoadInter400 />
Expand Down
3 changes: 3 additions & 0 deletions apps/electron/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
LoadInter800
} from 'app/components/next/LoadFont'
import Tamagui from '../tamagui.config'
import { FontsLoader } from 'app/components/FontsLoader'

export default class Document extends NextDocument {
static async getInitialProps({ renderPage }) {
Expand Down Expand Up @@ -58,6 +59,8 @@ export default class Document extends NextDocument {
<meta name="docsearch:language" content="en" />
<meta name="docsearch:version" content="1.0.0,latest" />
{/* <LoadInter100 /> */}
<FontsLoader />

<LoadInter200 />
<LoadInter300 />
<LoadInter400 />
Expand Down
3 changes: 3 additions & 0 deletions apps/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
LoadInter800
} from 'app/components/next/LoadFont'
import Tamagui from '../tamagui.config'
import { FontsLoader } from 'app/components/FontsLoader'

export default class Document extends NextDocument {
static async getInitialProps({ renderPage }) {
Expand Down Expand Up @@ -58,6 +59,8 @@ export default class Document extends NextDocument {
<meta name="docsearch:language" content="en" />
<meta name="docsearch:version" content="1.0.0,latest" />
{/* <LoadInter100 /> */}
<FontsLoader />

<LoadInter200 />
<LoadInter300 />
<LoadInter400 />
Expand Down
7 changes: 7 additions & 0 deletions data/public/fonts/roboto-regular.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@font-face {
font-family: 'Roboto-Regular';
src: url('roboto-regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: block;
}
Binary file added data/public/fonts/roboto-regular.woff2
Binary file not shown.
7 changes: 7 additions & 0 deletions packages/app/components/FontsLoader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { LoadFont } from "./next/LoadFont";

export const FontsLoader = () => (
<>
<LoadFont woff2File="/public/fonts/roboto-regular.woff2" cssFile="/public/fonts/roboto-regular.css" />
</>
)

0 comments on commit cbc3a3f

Please sign in to comment.