-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
_index.scss
166 lines (150 loc) · 3.34 KB
/
_index.scss
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/* ==========================================================================
generic.reset
A reset of sensible defaults, roughly based on Andy Bell's excellent
Modern CSS Reset(https://hankchizljaw.com/wrote/a-modern-css-reset/).
/ =========================================================================== */
@use 'sass:math';
@use '../../settings/defaults';
@use '../../tools/space';
/**
* Set the global `box-sizing` state to `border-box`. As per:
* paulirish.com/2012/box-sizing-border-box-ftw
*/
* {
box-sizing: border-box;
&::before,
&::after {
box-sizing: inherit;
}
}
/**
* 1. Ensure the page always fills at least the entire height of the viewport.
* 2. Always add the vertical scrollbar to prevent layout shifting
* 3. Smooth anchor scrolling
* 4. Apply the `$font-size` & `$line-height-ratio`
*/
html {
min-block-size: 100vh; /* [1] */
overflow-y: scroll; /* [2] */
scroll-behavior: smooth; /* [3] */
font-size: #{math.div(defaults.$font-size, 16px) * 1em}; /* [4] */
line-height: #{defaults.$line-height-ratio}; /* [4] */
}
/**
* Remove default margins from elements
*/
body,
hgroup,
h1,
h2,
h3,
h4,
h5,
h6,
p,
address,
table,
pre,
ul,
ol,
li,
figure,
figcaption,
blockquote,
hr,
dl,
dd,
fieldset,
button,
input,
select,
textarea {
margin: 0;
}
/**
* Default indentation value for lists
*/
ul,
ol {
padding-inline-start: space.get();
}
dd {
margin-inline-start: space.get();
}
/**
* Strip unwanted paddings & styling from elements
*/
button {
background: transparent;
}
button,
fieldset {
padding: 0;
}
button,
iframe,
fieldset {
border: 0;
}
/**
* 1. Change the font styles in all browsers.
*/
button,
input,
select,
textarea {
font: inherit;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */ /* stylelint-disable-line font-family-no-duplicate-names */
font-size: 1em; /* 2 */
}
/**
* Suppress the focus outline on links that cannot be accessed via keyboard.
* This prevents an unwanted focus outline from appearing around elements that
* might still respond to pointer events.
*/
[tabindex='-1']:focus {
outline: none !important;
}
/**
* Gets rid of the annoying outline for mouse users but preserves it for
* keyboard users, and is ignored by browsers that don’t support :focus-visible.
* As per: https://twitter.com/LeaVerou/status/1045768279753666562
*/
:focus:not(:focus-visible) {
outline: none;
}
/**
* Image
*
* 1. By default all images are fluid
* 2. Render `alt` visually offset when images don't load
*/
img {
display: block;
max-inline-size: 100%; /* [1] */
block-size: auto; /* [1] */
font-style: italic; /* [2] */
}
/**
* Remove all animations and transitions for people that prefer not to see them
* 1. Do not remove the animation altogether, but make it super-fast. This has
* several benefits:
* - Preserves the end state of an animation/transition
* - Preserves the possibility to listen to `animationend` and
* `transitionend` events.
* 2. Only one animation cycle
*/
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important; /* [1] */
animation-iteration-count: 1 !important; /* [2] */
transition-duration: 0.01ms !important; /* [1] */
scroll-behavior: auto !important;
}
}