Skip to content

Commit

Permalink
fix: load spoqa font with webfontloader (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna922 authored May 16, 2024
1 parent 35c8d84 commit 3d0b90a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
14 changes: 0 additions & 14 deletions index.html

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@storybook/react-vite": "^8.0.2",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/webfontloader": "^1.6.38",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
Expand All @@ -70,6 +71,7 @@
"vite": "^4.4.5",
"vite-plugin-dts": "^3.5.3",
"vite-tsconfig-paths": "^4.2.0",
"webfontloader": "^1.6.28",
"xmldom": "^0.6.0"
},
"packageManager": "[email protected]"
Expand Down
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

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

20 changes: 14 additions & 6 deletions src/style/globalStyle/GlobalStyle.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { createGlobalStyle } from 'styled-components';
import WebFont from 'webfontloader';

WebFont.load({
custom: {
families: ['Spoqa Han Sans Neo'],
urls: ['//spoqa.github.io/spoqa-han-sans/css/SpoqaHanSansNeo.css'],
},
});

export const GlobalStyles = createGlobalStyle`
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Spoqa Han Sans Neo', 'sans-serif';
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Spoqa Han Sans Neo', 'sans-serif';
}
`;

0 comments on commit 3d0b90a

Please sign in to comment.