-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_reset.scss
157 lines (129 loc) · 2.45 KB
/
_reset.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
$box-sizing: border-box !default;
$scroll-behavior: smooth !default;
@mixin -font-unset {
font: {
family: unset;
size: unset;
weight: unset;
}
color: unset;
}
//region Mixins
@mixin figure {
margin: 0;
padding: 0;
}
@mixin picture {
line-height: 0;
font-size: 0;
}
// Meant to be used on a:any-link
@mixin link {
color: unset;
outline: none;
-webkit-tap-highlight-color: transparent;
}
@mixin button {
@include -font-unset;
appearance: none;
border: none;
padding: 0;
background: none;
text-transform: unset;
-webkit-tap-highlight-color: transparent;
&[disabled] {
cursor: not-allowed;
}
&:not([disabled]) {
cursor: pointer;
}
}
@mixin list() {
list-style: none;
padding: 0;
}
@mixin form-fieldset {
padding: 0;
border: none;
}
@mixin form-control($keep-number-spinner: false) {
@include -font-unset;
appearance: none;
line-height: unset;
background-color: unset;
outline: none;
border: none;
border-radius: 0;
min-width: 0;
&[disabled] {
-webkit-text-fill-color: currentcolor; /* iOS Safari */
opacity: 1; /* iOS Safari: prevents background-color transparency */
}
@if not $keep-number-spinner {
&[type=number] {
-moz-appearance: textfield;
&::-webkit-inner-spin-button, &::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
}
}
//endregion Mixins
//region Classes
@mixin classes {
@at-root {
a:any-link.unstyle {
@include link;
}
button.unstyle
{
@include button;
}
:where(ul, ol).unstyle /* Safari 14+ */
{
@include list;
}
:where(input, select).unstyle /* Safari 14+ */
{
@include form-control;
}
fieldset.unstyle
{
@include form-fieldset;
}
picture.unstyle {
@include picture;
}
}
}
//endregion Classes
//region Rules
@mixin rules() {
@at-root html {
text-size-adjust: none;
&, *, *::before, *::after { // Universal selector '*' has no effect on specificity
margin: 0;
box-sizing: $box-sizing;
scroll-behavior: $scroll-behavior;
}
a:any-link { // :link or :visited that has [href]
outline: none;
-webkit-tap-highlight-color: transparent;
}
figure {
@include figure;
}
picture {
@include picture;
}
video:focus-within {
outline: none;
}
}
}
//endregion Rules
@mixin styles {
@include classes;
@include rules;
}