Skip to content

Commit

Permalink
refactor 성능 개선 : Preconnect to requered origins (#771)
Browse files Browse the repository at this point in the history
* refactor: 성능개선 Preconnect to requered origins (font)

* fix: storybook에서 pretendard 폰트가 적용되도록 스토리북 preview.tsx 수정
  • Loading branch information
soi-ha authored and Todari committed Oct 23, 2024
1 parent ae8faa9 commit c381ccf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
23 changes: 18 additions & 5 deletions client/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import type {Preview} from '@storybook/react';
import {HDesignProvider} from '../src/components/Design';
import {css, Global} from '@emotion/react';

const preview: Preview = {
parameters: {
Expand Down Expand Up @@ -30,11 +31,23 @@ const preview: Preview = {
},
},
decorators: [
Story => (
<HDesignProvider>
<Story />
</HDesignProvider>
),
Story => {
return (
<div>
<Global
styles={css`
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
body {
font-family: 'Pretendard', sans-serif;
}
`}
/>
<HDesignProvider>
<Story />
</HDesignProvider>
</div>
);
},
],
};

Expand Down
3 changes: 3 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

<link rel="canonical" href="https://haengdong.pro/" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" rel="stylesheet" />
<script
src="https://t1.kakaocdn.net/kakao_js_sdk/2.7.2/kakao.min.js"
integrity="sha384-TiCUE00h649CAMonG018J2ujOgDKW/kVWlChEuu4jK2vxfAAD0eZxzCKakxg55G4"
Expand Down
2 changes: 0 additions & 2 deletions client/src/GlobalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {css} from '@emotion/react';

// reset css -> index css
export const GlobalStyle = css`
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) {
all: unset;
display: revert;
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/Design/theme/GlobalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {css} from '@emotion/react';

// reset css -> index css
export const GlobalStyle = css`
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) {
all: unset;
display: revert;
Expand Down

0 comments on commit c381ccf

Please sign in to comment.