aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/constants/globalStyle.tsx
blob: b22a5c6db0e15feba9b520e051259a2b1da3e1f8 (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
import { createGlobalStyle, withTheme } from 'styled-components';
import {cssReset} from 'ts/@next/constants/cssReset';

interface GlobalStyle {
    theme: {
        bgColor: string;
        textColor: string;
    };
}

const GlobalStyles = withTheme(createGlobalStyle<GlobalStyle> `
    ${cssReset};

    @font-face {
        font-family: "Formular";
        src: url("/fonts/Formular-Light.woff2") format("woff2"), url("/fonts/Formular-Light.woff") format("woff");
        font-weight: 300;
        font-display: swap;
    }

    @font-face {
        font-family: "Formular";
        src: url("/fonts/Formular-Regular.woff2") format("woff2"), url("/fonts/Formular-Regular.woff") format("woff");
        font-weight: 400;
        font-display: swap;
    }

    html {
        font-size: 18px;
        background-color: ${props => props.theme.bgColor};
    }

    body {
        font-family: 'Formular', sans-serif !important;
        -webkit-font-smoothing: antialiased;
        color: ${props => props.theme.textColor};
    }

    .visuallyHidden {
        position: absolute !important;
        clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
        clip: rect(1px, 1px, 1px, 1px);
        padding:0 !important;
        border:0 !important;
        height: 1px !important;
        width: 1px !important;
        overflow: hidden;
    }

    img {
        max-width: 100%;
        object-fit: contain;
    }

    p, li {
        font-size: 1rem;
        line-height: 1.444444444em; // 26px
    }

    :root a {
        color: inherit;
        text-decoration: none;
    }

    svg + p,
    img + p {
        padding-top: 30px;
    }
`);

export { GlobalStyles };