Skip to content

Commit

Permalink
Extract global style to component
Browse files Browse the repository at this point in the history
Extract global style to component.
  • Loading branch information
hannut91 committed Aug 9, 2020
1 parent acfb86d commit 8b7f13a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,19 @@ import {
} from 'react-router-dom';

import styled from '@emotion/styled';
import { Global, css } from '@emotion/core';

import GlobalStyle from './GlobalStyle';
import RetrospectivesPage from './RetrospectivesPage';
import WritingPage from './WritingPage';

const GlobalStyles = css`
@font-face {
font-family: 'MapoFlowerIsland';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/MapoFlowerIslandA.woff')
format('woff');
font-weight: normal;
font-style: normal;
}
* {
font-family: 'MapoFlowerIsland';
}
`;

const Header = styled.div({
margin: '5em 10em',
});

export default function App() {
return (
<>
<Global styles={GlobalStyles} />
<GlobalStyle />
<Header>
<h1>
<Link to="/">함께 회,고(Go) 해요.</Link>
Expand Down
21 changes: 21 additions & 0 deletions src/GlobalStyle.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';

import { Global, css } from '@emotion/core';

const GlobalStyles = css`
@font-face {
font-family: 'MapoFlowerIsland';
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/[email protected]/MapoFlowerIslandA.woff')
format('woff');
font-weight: normal;
font-style: normal;
}
* {
font-family: 'MapoFlowerIsland';
}
`;

export default function GlobalStyle() {
return <Global styles={GlobalStyles} />;
}

0 comments on commit 8b7f13a

Please sign in to comment.