-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract global style to component.
- Loading branch information
Showing
2 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} />; | ||
} |