-
Notifications
You must be signed in to change notification settings - Fork 2
/
GlobalStyles.js
107 lines (89 loc) · 2.33 KB
/
GlobalStyles.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import { createGlobalStyle } from 'styled-components/macro';
import { COLORS, FONTS, FONT_SIZES, BREAKPOINTS } from '../constants';
const GlobalStyles = createGlobalStyle`
/* RESET from https://piccalil.li/blog/a-modern-css-reset */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* Remove list styles on ul, ol elements */
ul,
ol {
list-style: none;
}
/* Set core root defaults */
html:focus-within {
scroll-behavior: smooth;
}
/* Set core body defaults */
body {
min-height: 100vh;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make images easier to work with */
img,
picture {
max-width: 100%;
display: block;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
/* GLOBAL STYLES */
body {
background-color: ${COLORS.lightCream[100]};
font-family: ${FONTS.primary};
font-size: 15px;
line-height: 1.67;
width: 88%;
max-width: 1440px;
margin: 0 auto;
margin-bottom: 72px;
/* overflow-x: hidden; */
@media ${BREAKPOINTS.laptop} {
font-size: ${FONT_SIZES.xs};
line-height: 1.625;
}
@media ${BREAKPOINTS.desktop} {
margin-bottom: 77px;
}
}
h1, h2, h3, h4, h5, h6 {
font-family: ${FONTS.secondary};
}
h1 {
line-height: 1;
}
a:focus, button:focus {
outline: 2px dotted ${COLORS.lightCyan};
outline-offset: 2px;
}
`;
export default GlobalStyles;