Skip to content

Commit d2637fa

Browse files
committed
Use styled-jsx for amp support
1 parent 987f720 commit d2637fa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

pages/_app.js

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Layout from '~/components/layout/app'
77
import DataContext from '~/lib/data-context'
88

99
import baseTheme from '../styles/themes/base'
10+
import fontTheme from '../styles/themes/font'
1011
import withTypeStyles from '../styles/with-type'
1112
import nprogressStyles from '../styles/nprogress'
1213

@@ -43,6 +44,9 @@ function MyApp({ Component, pageProps }) {
4344
</Head>
4445
<Layout data={data}>
4546
<Component {...pageProps} />
47+
<style jsx global>
48+
{fontTheme}
49+
</style>
4650
<style jsx global>
4751
{baseTheme}
4852
</style>

styles/global.css

-3
This file was deleted.

styles/themes/font.css renamed to styles/themes/font.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import css from 'styled-jsx/css'
2+
3+
export default css.global`
14
/* latin */
25
@font-face {
36
font-family: 'Inter';
@@ -626,3 +629,4 @@ in most cases, they are not downloaded at all */
626629
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
627630
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
628631
}
632+
`

0 commit comments

Comments
 (0)