-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-ssr.js
60 lines (55 loc) · 1.74 KB
/
gatsby-ssr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React from 'react'
import { createGlobalStyle } from 'styled-components'
import { CssBaseline, ThemeProvider } from '@material-ui/core'
import theme from './src/styles/theme'
import { Helmet } from 'react-helmet'
import Kjeks from './src/components/cookie'
const GlobalStyles = createGlobalStyle`
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body, html {
font-weight: 400;
height: 100%;
font-size: 16px;
}
body {
font-family: 'Libre Caslon Text', serif;
}
h1,h2,h3,h4,h5,h6{
/* font-family: 'Libre Baskerville', serif; */
font-family: 'Libre Caslon Display', serif;
font-weight: 400;
}
h1{font-size: 3.75}
h3{
font-size: 1.4rem;
}
`
const Viewport = ({ children }) => {
return (
<Helmet>
{/* To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <head> element. */}
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
{children}
</Helmet>
)
}
export const wrapRootElement = ({ element }) => (
<ThemeProvider theme={theme}>
<Viewport />
<CssBaseline />
<GlobalStyles />
{element}
<Kjeks />
</ThemeProvider>
)