@onereach/styles 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/index.css +366 -0
- package/dist/index.css.map +1 -0
- package/dist/index.min.css +1 -0
- package/package.json +45 -0
- package/src/base/_animation.scss +19 -0
- package/src/base/_generic.scss +42 -0
- package/src/base/_reset.scss +149 -0
- package/src/base/_v-transitions.scss +13 -0
- package/src/base/index.scss +4 -0
- package/src/components/base/_button.scss +290 -0
- package/src/components/base/_icon.scss +11 -0
- package/src/components/base/_loader.scss +51 -0
- package/src/components/modern/_button.scss +6 -0
- package/src/main.scss +3 -0
- package/src/utils/functions/_breakpoint.scss +33 -0
- package/src/utils/functions/_get-font-size.scss +19 -0
- package/src/utils/functions/_get-font-weight.scss +14 -0
- package/src/utils/functions/_get-line-height.scss +19 -0
- package/src/utils/functions/_get-spacing.scss +18 -0
- package/src/utils/functions/_get-theme-color.scss +0 -0
- package/src/utils/functions/_get-transition-func.scss +13 -0
- package/src/utils/functions/_get-transition-time.scss +13 -0
- package/src/utils/functions/_px-to-rem.scss +9 -0
- package/src/utils/functions/index.scss +9 -0
- package/src/utils/index.scss +2 -0
- package/src/utils/mixins/_absolute-stretch.scss +7 -0
- package/src/utils/mixins/_active.scss +7 -0
- package/src/utils/mixins/_breakpont.scss +124 -0
- package/src/utils/mixins/_extra-click-area.scss +5 -0
- package/src/utils/mixins/_focus.scss +7 -0
- package/src/utils/mixins/_height-vh.scss +19 -0
- package/src/utils/mixins/_hover.scss +17 -0
- package/src/utils/mixins/_visual-hidden.scss +10 -0
- package/src/utils/mixins/index.scss +8 -0
- package/src/variables/_css-vars.scss +26 -0
- package/src/variables/index.scss +2 -0
- package/src/variables/tokens/design-tokens.scss +74 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
@import "../../utils";
|
|
2
|
+
|
|
3
|
+
$btn-min-width: px-to-rem(96) !default;
|
|
4
|
+
$btn-padding: get-spacing(2) get-spacing(4) !default;
|
|
5
|
+
$btn-cursor: pointer !default;
|
|
6
|
+
|
|
7
|
+
$btn-font-size: get-font-size(1) !default;
|
|
8
|
+
$btn-font-weight: get-font-weight(1) !default;
|
|
9
|
+
$btn-line-height: px-to-rem(22) !default;
|
|
10
|
+
|
|
11
|
+
$btn-border-width: px-to-rem(1) !default;
|
|
12
|
+
$btn-border-style: solid !default;
|
|
13
|
+
$btn-border-radius: px-to-rem(4) !default;
|
|
14
|
+
|
|
15
|
+
$btn-letter-spacing: px-to-rem(-0.15) !default;
|
|
16
|
+
|
|
17
|
+
$btn-transition-func: get-transition-func() !default;
|
|
18
|
+
$btn-transition-time: get-transition-time() !default;
|
|
19
|
+
|
|
20
|
+
$btn-box-shadow: 0 px-to-rem(1) px-to-rem(2) 0 hsla(0, 0%, 0%, 20%) !default;
|
|
21
|
+
$btn-box-shadow-second: 0 px-to-rem(1) px-to-rem(2) 0 hsla(0, 0%, 0%, 10%) !default;
|
|
22
|
+
|
|
23
|
+
$btn-icon-font-size: calc(#{$btn-font-size} + #{px-to-rem(6)});
|
|
24
|
+
|
|
25
|
+
$list-of-colors: (primary, error, "grey");
|
|
26
|
+
$btn-types: (outline, text, icon);
|
|
27
|
+
|
|
28
|
+
@mixin default-color-mixin() {
|
|
29
|
+
@each $key in $list-of-colors {
|
|
30
|
+
&.is-#{$key}-color {
|
|
31
|
+
--btn-#{$key}-color: var(--c-white);
|
|
32
|
+
--btn-#{$key}-bg-color: var(--c-#{$key});
|
|
33
|
+
--btn-#{$key}-darken-3: var(--c-#{$key}-darken-3);
|
|
34
|
+
--btn-#{$key}-darken-5: var(--c-#{$key}-darken-5);
|
|
35
|
+
--btn-#{$key}-lighten-20: var(--c-#{$key}-lighten-20);
|
|
36
|
+
|
|
37
|
+
color: var(--btn-#{$key}-color);
|
|
38
|
+
background-color: var(--btn-#{$key}-bg-color);
|
|
39
|
+
border-color: var(--c-#{$key});
|
|
40
|
+
|
|
41
|
+
.base-button {
|
|
42
|
+
&--loader {
|
|
43
|
+
&::after {
|
|
44
|
+
border-color: var(--btn-#{$key}-color);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@include hover {
|
|
50
|
+
background-color: var(--btn-#{$key}-darken-3);
|
|
51
|
+
border-color: var(--btn-#{$key}-darken-3);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@include active {
|
|
55
|
+
background-color: var(--btn-#{$key}-darken-5);
|
|
56
|
+
border-color: var(--btn-#{$key}-darken-5);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:disabled,
|
|
60
|
+
&.is-loading {
|
|
61
|
+
background-color: var(--btn-#{$key}-lighten-20);
|
|
62
|
+
border-color: var(--btn-#{$key}-lighten-20);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin outline-type() {
|
|
69
|
+
&.outline-type {
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
box-shadow: none;
|
|
72
|
+
|
|
73
|
+
.base-button {
|
|
74
|
+
&--loader {
|
|
75
|
+
&::after {
|
|
76
|
+
border-color: inherit;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@each $key in $list-of-colors {
|
|
82
|
+
&.is-#{$key}-color {
|
|
83
|
+
--btn-#{$key}-color: var(--c-#{$key});
|
|
84
|
+
--btn-#{$key}-darken-3: var(--c-#{$key}-darken-3);
|
|
85
|
+
--btn-#{$key}-darken-5: var(--c-#{$key}-darken-5);
|
|
86
|
+
--btn-#{$key}-lighten-20: var(--c-#{$key}-lighten-20);
|
|
87
|
+
|
|
88
|
+
color: var(--btn-#{$key}-color);
|
|
89
|
+
border-color: var(--btn-#{$key}-color);
|
|
90
|
+
|
|
91
|
+
.base-button {
|
|
92
|
+
&--loader {
|
|
93
|
+
&::after {
|
|
94
|
+
border-color: var(--btn-#{$key}-lighten-20);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include hover {
|
|
100
|
+
color: var(--c-white);
|
|
101
|
+
background-color: var(--btn-#{$key}-darken-3);
|
|
102
|
+
border-color: var(--btn-#{$key}-darken-3);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@include active {
|
|
106
|
+
color: var(--c-white);
|
|
107
|
+
background-color: var(--btn-#{$key}-darken-5);
|
|
108
|
+
border-color: var(--btn-#{$key}-darken-5);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:disabled,
|
|
112
|
+
&.is-loading {
|
|
113
|
+
color: var(--btn-#{$key}-lighten-20);
|
|
114
|
+
background-color: transparent;
|
|
115
|
+
border-color: var(--btn-#{$key}-lighten-20);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// states
|
|
121
|
+
@include hover {
|
|
122
|
+
box-shadow: $btn-box-shadow;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@include active {
|
|
126
|
+
box-shadow: $btn-box-shadow-second;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.is-loading {
|
|
130
|
+
box-shadow: $btn-box-shadow-second;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@mixin text-type() {
|
|
136
|
+
&.text-type {
|
|
137
|
+
min-width: auto;
|
|
138
|
+
padding: 0;
|
|
139
|
+
background-color: transparent;
|
|
140
|
+
border: 1px solid transparent;
|
|
141
|
+
box-shadow: none;
|
|
142
|
+
|
|
143
|
+
@each $key in $list-of-colors {
|
|
144
|
+
&.is-#{$key}-color {
|
|
145
|
+
--btn-#{$key}-color: var(--c-#{$key});
|
|
146
|
+
--btn-#{$key}-darken-3: var(--c-#{$key}-darken-3);
|
|
147
|
+
--btn-#{$key}-darken-5: var(--c-#{$key}-darken-5);
|
|
148
|
+
--btn-#{$key}-lighten-20: var(--c-#{$key}-lighten-20);
|
|
149
|
+
|
|
150
|
+
color: var(--btn-#{$key}-color);
|
|
151
|
+
background-color: transparent;
|
|
152
|
+
border-color: transparent;
|
|
153
|
+
|
|
154
|
+
@include hover {
|
|
155
|
+
color: var(--btn-#{$key}-darken-3);
|
|
156
|
+
background-color: transparent;
|
|
157
|
+
border-color: transparent;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@include active {
|
|
161
|
+
color: var(--btn-#{$key}-darken-5);
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
border-color: transparent;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:disabled,
|
|
167
|
+
&.is-loading {
|
|
168
|
+
color: var(--btn-#{$key}-lighten-20);
|
|
169
|
+
background-color: transparent;
|
|
170
|
+
border-color: transparent;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@mixin is-loading() {
|
|
178
|
+
&.is-loading {
|
|
179
|
+
cursor: progress !important;
|
|
180
|
+
|
|
181
|
+
.base-button {
|
|
182
|
+
&--loader {
|
|
183
|
+
visibility: visible;
|
|
184
|
+
opacity: 1;
|
|
185
|
+
|
|
186
|
+
&::after {
|
|
187
|
+
animation-play-state: running;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&--content {
|
|
192
|
+
opacity: 0;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@mixin is-fullwidth() {
|
|
199
|
+
&.is-fullwidth {
|
|
200
|
+
width: 100%;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.base-button {
|
|
205
|
+
-moz-appearance: none;
|
|
206
|
+
-webkit-appearance: none;
|
|
207
|
+
position: relative;
|
|
208
|
+
box-sizing: border-box;
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
min-width: $btn-min-width;
|
|
213
|
+
padding: $btn-padding;
|
|
214
|
+
font-family: inherit;
|
|
215
|
+
font-size: $btn-font-size;
|
|
216
|
+
font-weight: $btn-font-weight;
|
|
217
|
+
line-height: $btn-line-height;
|
|
218
|
+
letter-spacing: $btn-letter-spacing;
|
|
219
|
+
cursor: $btn-cursor;
|
|
220
|
+
border: $btn-border-width $btn-border-style;
|
|
221
|
+
border-radius: $btn-border-radius;
|
|
222
|
+
box-shadow: $btn-box-shadow;
|
|
223
|
+
transition-timing-function: $btn-transition-func;
|
|
224
|
+
transition-duration: $btn-transition-time;
|
|
225
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
226
|
+
|
|
227
|
+
.base-icon {
|
|
228
|
+
font-size: $btn-icon-font-size;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&--loader {
|
|
232
|
+
position: absolute !important;
|
|
233
|
+
top: 0;
|
|
234
|
+
left: 0;
|
|
235
|
+
z-index: 1;
|
|
236
|
+
width: 100%;
|
|
237
|
+
height: 100%;
|
|
238
|
+
pointer-events: none;
|
|
239
|
+
visibility: hidden;
|
|
240
|
+
opacity: 0;
|
|
241
|
+
transition: opacity $btn-transition-time $btn-transition-func;
|
|
242
|
+
|
|
243
|
+
&::after {
|
|
244
|
+
border-color: inherit;
|
|
245
|
+
animation-play-state: paused;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
&--content {
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
align-items: center;
|
|
252
|
+
justify-content: center;
|
|
253
|
+
transition: opacity $btn-transition-time $btn-transition-func;
|
|
254
|
+
|
|
255
|
+
&-prepend,
|
|
256
|
+
&-append {
|
|
257
|
+
display: inline-flex;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&-prepend {
|
|
261
|
+
margin-right: px-to-rem(8);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&-append {
|
|
265
|
+
margin-left: px-to-rem(8);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// sizes
|
|
270
|
+
&.is-small {
|
|
271
|
+
font-size: calc(#{$btn-font-size} - #{px-to-rem(2)});
|
|
272
|
+
line-height: 1;
|
|
273
|
+
|
|
274
|
+
.base-icon {
|
|
275
|
+
font-size: $btn-icon-font-size;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
@include default-color-mixin;
|
|
280
|
+
@include outline-type;
|
|
281
|
+
@include text-type;
|
|
282
|
+
@include is-loading;
|
|
283
|
+
@include is-fullwidth;
|
|
284
|
+
|
|
285
|
+
// disabled styles for all btn-types
|
|
286
|
+
&:disabled {
|
|
287
|
+
cursor: not-allowed;
|
|
288
|
+
box-shadow: none;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use "../../utils/functions" as *;
|
|
2
|
+
@use "../../utils/mixins" as *;
|
|
3
|
+
@use "../../base/animation" as *;
|
|
4
|
+
|
|
5
|
+
$loader-width: px-to-rem(24) !default;
|
|
6
|
+
$loader-height: $loader-width !default;
|
|
7
|
+
$loader-border-width: 2px !default;
|
|
8
|
+
$loader-border-color: inherit;
|
|
9
|
+
|
|
10
|
+
// loader types mixins
|
|
11
|
+
@mixin default-type() {
|
|
12
|
+
&.is-default {
|
|
13
|
+
&::after {
|
|
14
|
+
width: $loader-width;
|
|
15
|
+
height: $loader-height;
|
|
16
|
+
content: '';
|
|
17
|
+
border-color: $loader-border-color;
|
|
18
|
+
border-top: $loader-border-width solid;
|
|
19
|
+
border-right: $loader-border-width solid;
|
|
20
|
+
border-bottom: $loader-border-width solid transparent !important;
|
|
21
|
+
border-left: $loader-border-width solid;
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
animation: spinAround 0.7s linear infinite;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin text-type() {
|
|
29
|
+
&.is-text {
|
|
30
|
+
> span {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@for $i from 0 through 3 {
|
|
35
|
+
.base-loader--dot:nth-child(#{$i}) {
|
|
36
|
+
animation: fade 1s ease-out $i * 0.2s infinite;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.base-loader {
|
|
43
|
+
position: relative;
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
|
|
48
|
+
// types
|
|
49
|
+
@include default-type;
|
|
50
|
+
@include text-type;
|
|
51
|
+
}
|
package/src/main.scss
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@function breakpoint($key: "sm") {
|
|
2
|
+
@return map-get($breakpoints, $key);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function breakpoint-next(
|
|
6
|
+
$name,
|
|
7
|
+
$breakpoints: $breakpoints,
|
|
8
|
+
$breakpoint-names: map-keys($breakpoints)
|
|
9
|
+
) {
|
|
10
|
+
$n: index($breakpoint-names, $name);
|
|
11
|
+
|
|
12
|
+
@return if(
|
|
13
|
+
$n != null and $n < length($breakpoint-names),
|
|
14
|
+
nth($breakpoint-names, $n + 1),
|
|
15
|
+
null
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@function breakpoint-min($name, $breakpoints: $breakpoints) {
|
|
20
|
+
$min: map-get($breakpoints, $name);
|
|
21
|
+
|
|
22
|
+
@return if($min != 0, $min, null);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@function breakpoint-max($name, $breakpoints: $breakpoints) {
|
|
26
|
+
$next: breakpoint-next($name, $breakpoints);
|
|
27
|
+
|
|
28
|
+
@return if($next, breakpoint-min($next, $breakpoints) - 0.02, null);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@function breakpoint-infix($name, $breakpoints: $breakpoints) {
|
|
32
|
+
@return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "../../variables/tokens/design-tokens" as *;
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "px-to-rem" as *;
|
|
5
|
+
|
|
6
|
+
@function get-font-size($levelIndex: 0, $unit: rem) {
|
|
7
|
+
$value: map.get($design-tokens, typography, font-sizes, string.quote(level-#{$levelIndex}));
|
|
8
|
+
$defaultValue: map.get($design-tokens, typography, line-heights, string.quote(level-0));
|
|
9
|
+
|
|
10
|
+
@if $value and $unit == rem {
|
|
11
|
+
@return px-to-rem($value);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@else if $value and $unit != rem {
|
|
15
|
+
@return #{$value + $unit};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@return $defaultValue or 0;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use "../../variables/tokens/design-tokens" as *;
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
|
|
5
|
+
@function get-font-weight($levelIndex: 0) {
|
|
6
|
+
$value: map.get($design-tokens, typography, font-weights, string.quote(level-#{$levelIndex}));
|
|
7
|
+
$defaultValue: map.get($design-tokens, typography, font-weights, string.quote(level-0));
|
|
8
|
+
|
|
9
|
+
@if $value {
|
|
10
|
+
@return $value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@return $defaultValue or normal;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "../../variables/tokens/design-tokens" as *;
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "px-to-rem" as *;
|
|
5
|
+
|
|
6
|
+
@function get-line-height($levelIndex: 0, $unit: rem) {
|
|
7
|
+
$value: map.get($design-tokens, typography, line-heights, string.quote(level-#{$levelIndex}));
|
|
8
|
+
$defaultValue: map.get($design-tokens, typography, line-heights, string.quote(level-0));
|
|
9
|
+
|
|
10
|
+
@if $value and $unit == rem {
|
|
11
|
+
@return px-to-rem($value);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@else if $value and $unit != rem {
|
|
15
|
+
@return #{$value + $unit};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@return $defaultValue or 1;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use "../../variables/tokens/design-tokens" as *;
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "px-to-rem" as *;
|
|
5
|
+
|
|
6
|
+
@function get-spacing($levelIndex: 0, $unit: rem) {
|
|
7
|
+
$value: map.get($design-tokens, spacings, string.quote(level-#{$levelIndex}));
|
|
8
|
+
|
|
9
|
+
@if $value and $unit == rem {
|
|
10
|
+
@return px-to-rem($value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@else if $value and $unit != rem {
|
|
14
|
+
@return #{$value + $unit};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@return 0;
|
|
18
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use "../../variables/tokens/design-tokens" as *;
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
|
|
4
|
+
@function get-transition-func() {
|
|
5
|
+
$value: map.get($design-tokens, transition, function);
|
|
6
|
+
$defaultValue: cubic-bezier(0.12, 0.39, 0.5, 0.93);
|
|
7
|
+
|
|
8
|
+
@if $value {
|
|
9
|
+
@return $value;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@return $defaultValue;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use "../../variables/tokens/design-tokens" as *;
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
|
|
4
|
+
@function get-transition-time() {
|
|
5
|
+
$value: map.get($design-tokens, transition, time);
|
|
6
|
+
$defaultValue: 0.25s;
|
|
7
|
+
|
|
8
|
+
@if $value {
|
|
9
|
+
@return $value;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@return $defaultValue;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//Function to convert px value into rem
|
|
2
|
+
//You can replace rem with any other value you want (rem is most preferred value for web)
|
|
3
|
+
@use "sass:math";
|
|
4
|
+
|
|
5
|
+
@function px-to-rem($target: 16, $context: 16) {
|
|
6
|
+
@if $target == 0 { @return 0; }
|
|
7
|
+
|
|
8
|
+
@return math.div($target, $context) * 1rem;
|
|
9
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
$breakpoints: (
|
|
2
|
+
"sm": 0,
|
|
3
|
+
"md": 768,
|
|
4
|
+
"lg": 1280,
|
|
5
|
+
"xl": 1920
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
|
|
9
|
+
// Makes the @content apply to the given breakpoint and wider.
|
|
10
|
+
@mixin respUp($name, $landscape: false, $breakpoints: $breakpoints) {
|
|
11
|
+
$min: breakpoint-min($name, $breakpoints);
|
|
12
|
+
|
|
13
|
+
@if $min and $landscape {
|
|
14
|
+
@media (min-width: #{$min}px) and (orientation: landscape) {
|
|
15
|
+
@content;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@else if $min {
|
|
20
|
+
@media (min-width: #{$min}px) {
|
|
21
|
+
@content;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@else {
|
|
26
|
+
@content;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Media of at most the maximum breakpoint width. No query for the largest breakpoint.
|
|
31
|
+
// Makes the @content apply to the given breakpoint and narrower.
|
|
32
|
+
@mixin respDown($name, $landscape: false, $breakpoints: $breakpoints) {
|
|
33
|
+
$max: breakpoint-max($name, $breakpoints);
|
|
34
|
+
|
|
35
|
+
@if $max and $landscape {
|
|
36
|
+
@media (max-width: #{$max}px) and (orientation: landscape) {
|
|
37
|
+
@content;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@else if $max {
|
|
42
|
+
@media (max-width: #{$max}px) {
|
|
43
|
+
@content;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@if $name == sm {
|
|
47
|
+
.rwc-embed & {
|
|
48
|
+
@content;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@else {
|
|
54
|
+
@content;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Media that spans multiple breakpoint widths.
|
|
59
|
+
// Makes the @content apply between the min and max breakpoints
|
|
60
|
+
@mixin respBetween(
|
|
61
|
+
$lower,
|
|
62
|
+
$upper,
|
|
63
|
+
$landscape: false,
|
|
64
|
+
$breakpoints: $breakpoints
|
|
65
|
+
) {
|
|
66
|
+
$min: breakpoint-min($lower, $breakpoints);
|
|
67
|
+
$max: breakpoint-max($upper, $breakpoints);
|
|
68
|
+
|
|
69
|
+
@if $min != null and $max != null and $landscape {
|
|
70
|
+
@media (min-width: #{$min}px) and (max-width: #{$max}px) and (orientation: landscape) {
|
|
71
|
+
@content;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@else if $min != null and $max != null {
|
|
76
|
+
@media (min-width: #{$min}px) and (max-width: #{$max}px) {
|
|
77
|
+
@content;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@else if $max == null {
|
|
82
|
+
@include respUp($lower, $landscape, $breakpoints) {
|
|
83
|
+
@content;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@else if $min == null {
|
|
88
|
+
@include respDown($upper, $landscape, $breakpoints) {
|
|
89
|
+
@content;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Media between the breakpoint's minimum and maximum widths.
|
|
95
|
+
// No minimum for the smallest breakpoint, and no maximum for the largest one.
|
|
96
|
+
// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
|
|
97
|
+
@mixin respOnly($name, $landscape: false, $breakpoints: $breakpoints) {
|
|
98
|
+
$min: breakpoint-min($name, $breakpoints);
|
|
99
|
+
$max: breakpoint-max($name, $breakpoints);
|
|
100
|
+
|
|
101
|
+
@if $min != null and $max != null and $landscape {
|
|
102
|
+
@media (min-width: #{$min}px) and (max-width: #{$max}px) and (orientation: landscape) {
|
|
103
|
+
@content;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@else if $min != null and $max != null {
|
|
108
|
+
@media (min-width: #{$min}px) and (max-width: #{$max}px) {
|
|
109
|
+
@content;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@else if $max == null {
|
|
114
|
+
@include respUp($name, $landscape, $breakpoints) {
|
|
115
|
+
@content;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@else if $min == null {
|
|
120
|
+
@include respDown($name, $landscape, $breakpoints) {
|
|
121
|
+
@content;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|