@oardi/css-utils 0.112.0 → 0.114.0
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/package.json +1 -1
- package/scss/components/progress.scss +194 -0
- package/scss/gap-responsive.scss +6 -4
- package/scss/gap.scss +6 -4
- package/scss/index.scss +1 -0
- package/scss/spacings-responsive.scss +31 -11
- package/scss/spacings.scss +31 -11
- package/scss/theme.scss +25 -0
- package/scss/variables.scss +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
@use '../layers.scss';
|
|
2
|
+
|
|
3
|
+
@layer components {
|
|
4
|
+
.progress {
|
|
5
|
+
--progress-block-size: 0.5rem;
|
|
6
|
+
--progress-inline-size: 8rem;
|
|
7
|
+
--progress-track-color: var(--bg-active);
|
|
8
|
+
--progress-value-color: var(--primary);
|
|
9
|
+
--progress-border-color: var(--control-border-color);
|
|
10
|
+
--progress-border-width: var(--border-width);
|
|
11
|
+
--progress-border-radius: 9999px;
|
|
12
|
+
--progress-animation-duration: 1.5s;
|
|
13
|
+
--progress-animation-easing: ease-in-out;
|
|
14
|
+
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: block;
|
|
17
|
+
inline-size: 100%;
|
|
18
|
+
block-size: var(--progress-block-size);
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
appearance: none;
|
|
21
|
+
border: var(--progress-border-width) solid var(--progress-border-color);
|
|
22
|
+
border-radius: var(--progress-border-radius);
|
|
23
|
+
background-color: var(--progress-track-color);
|
|
24
|
+
color: var(--progress-value-color);
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
accent-color: var(--progress-value-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.progress::-webkit-progress-bar {
|
|
30
|
+
background-color: var(--progress-track-color);
|
|
31
|
+
border-radius: inherit;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.progress::-webkit-progress-value {
|
|
35
|
+
background-color: var(--progress-value-color);
|
|
36
|
+
border-radius: inherit;
|
|
37
|
+
transition: inline-size var(--progress-animation-duration) var(--progress-animation-easing);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.progress::-moz-progress-bar {
|
|
41
|
+
background-color: var(--progress-value-color);
|
|
42
|
+
border-radius: inherit;
|
|
43
|
+
transition: inline-size var(--progress-animation-duration) var(--progress-animation-easing);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.progress:indeterminate {
|
|
47
|
+
background:
|
|
48
|
+
linear-gradient(
|
|
49
|
+
to right,
|
|
50
|
+
transparent 0%,
|
|
51
|
+
transparent 25%,
|
|
52
|
+
var(--progress-value-color) 25%,
|
|
53
|
+
var(--progress-value-color) 75%,
|
|
54
|
+
transparent 75%,
|
|
55
|
+
transparent 100%
|
|
56
|
+
) -100%
|
|
57
|
+
0 / 50% 100% no-repeat,
|
|
58
|
+
var(--progress-track-color);
|
|
59
|
+
animation: progress-indeterminate var(--progress-animation-duration)
|
|
60
|
+
var(--progress-animation-easing) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.progress:indeterminate::-webkit-progress-bar {
|
|
64
|
+
background: transparent;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.progress:indeterminate::-webkit-progress-value {
|
|
68
|
+
background: transparent;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.progress:indeterminate::-moz-progress-bar {
|
|
72
|
+
background: transparent;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.progress-sm {
|
|
76
|
+
--progress-block-size: 0.375rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.progress-md {
|
|
80
|
+
--progress-block-size: 0.5rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.progress-lg {
|
|
84
|
+
--progress-block-size: 0.75rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.progress-inline {
|
|
88
|
+
display: inline-block;
|
|
89
|
+
inline-size: var(--progress-inline-size);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.progress-block {
|
|
93
|
+
display: block;
|
|
94
|
+
inline-size: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.spinner {
|
|
98
|
+
--spinner-size: 1rem;
|
|
99
|
+
--spinner-border-width: 0.125rem;
|
|
100
|
+
--spinner-track-color: color-mix(in srgb, var(--spinner-color) 25%, transparent);
|
|
101
|
+
--spinner-color: var(--primary);
|
|
102
|
+
--spinner-animation-duration: 0.75s;
|
|
103
|
+
--spinner-animation-easing: linear;
|
|
104
|
+
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
display: inline-block;
|
|
107
|
+
flex: 0 0 auto;
|
|
108
|
+
inline-size: var(--spinner-size);
|
|
109
|
+
block-size: var(--spinner-size);
|
|
110
|
+
border: var(--spinner-border-width) solid var(--spinner-track-color);
|
|
111
|
+
border-inline-start-color: var(--spinner-color);
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
vertical-align: -0.125em;
|
|
114
|
+
animation: spinner-rotate var(--spinner-animation-duration) var(--spinner-animation-easing)
|
|
115
|
+
infinite;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.spinner-sm {
|
|
119
|
+
--spinner-size: 0.75rem;
|
|
120
|
+
--spinner-border-width: 0.125rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.spinner-md {
|
|
124
|
+
--spinner-size: 1rem;
|
|
125
|
+
--spinner-border-width: 0.125rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.spinner-lg {
|
|
129
|
+
--spinner-size: 1.5rem;
|
|
130
|
+
--spinner-border-width: 0.1875rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.spinner-inline {
|
|
134
|
+
display: inline-block;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.spinner-block {
|
|
138
|
+
display: block;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@each $color in primary, secondary, success, warning, error {
|
|
142
|
+
.progress-#{$color} {
|
|
143
|
+
--progress-value-color: var(--#{$color});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.spinner-#{$color} {
|
|
147
|
+
--spinner-color: var(--#{$color});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@keyframes progress-indeterminate {
|
|
152
|
+
to {
|
|
153
|
+
background-position:
|
|
154
|
+
200% 0,
|
|
155
|
+
0 0;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@keyframes spinner-rotate {
|
|
160
|
+
to {
|
|
161
|
+
transform: rotate(1turn);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@media (prefers-reduced-motion: reduce) {
|
|
166
|
+
.progress:indeterminate {
|
|
167
|
+
background-position:
|
|
168
|
+
50% 0,
|
|
169
|
+
0 0;
|
|
170
|
+
animation: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.spinner {
|
|
174
|
+
animation: none;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@media (forced-colors: active) {
|
|
179
|
+
.progress {
|
|
180
|
+
--progress-track-color: Canvas;
|
|
181
|
+
--progress-value-color: Highlight;
|
|
182
|
+
--progress-border-color: CanvasText;
|
|
183
|
+
|
|
184
|
+
forced-color-adjust: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.spinner {
|
|
188
|
+
--spinner-track-color: GrayText;
|
|
189
|
+
--spinner-color: Highlight;
|
|
190
|
+
|
|
191
|
+
forced-color-adjust: none;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
package/scss/gap-responsive.scss
CHANGED
|
@@ -7,17 +7,19 @@
|
|
|
7
7
|
@each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
|
|
8
8
|
@media (min-width: #{$bp-value}) {
|
|
9
9
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
10
|
-
$
|
|
10
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
11
|
+
$token: theme.spacing-token-suffix($key);
|
|
12
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
11
13
|
|
|
12
|
-
.gap-#{$bp}-#{$
|
|
14
|
+
.gap-#{$bp}-#{$suffix} {
|
|
13
15
|
gap: $spacing;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
.row-gap-#{$bp}-#{$
|
|
18
|
+
.row-gap-#{$bp}-#{$suffix} {
|
|
17
19
|
row-gap: $spacing;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
.column-gap-#{$bp}-#{$
|
|
22
|
+
.column-gap-#{$bp}-#{$suffix} {
|
|
21
23
|
column-gap: $spacing;
|
|
22
24
|
}
|
|
23
25
|
}
|
package/scss/gap.scss
CHANGED
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
@layer utilities {
|
|
6
6
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
7
|
-
$
|
|
7
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
8
|
+
$token: theme.spacing-token-suffix($key);
|
|
9
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
8
10
|
|
|
9
|
-
.gap-#{$
|
|
11
|
+
.gap-#{$suffix} {
|
|
10
12
|
gap: $spacing;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
.row-gap-#{$
|
|
15
|
+
.row-gap-#{$suffix} {
|
|
14
16
|
row-gap: $spacing;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
.column-gap-#{$
|
|
19
|
+
.column-gap-#{$suffix} {
|
|
18
20
|
column-gap: $spacing;
|
|
19
21
|
}
|
|
20
22
|
}
|
package/scss/index.scss
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
@forward './components/navbar.scss';
|
|
44
44
|
@forward './components/overlay.scss';
|
|
45
45
|
@forward './components/pagination.scss';
|
|
46
|
+
@forward './components/progress.scss';
|
|
46
47
|
@forward './components/range-slider.scss';
|
|
47
48
|
@forward './components/skeleton.scss';
|
|
48
49
|
@forward './components/stepper.scss';
|
|
@@ -36,50 +36,70 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
39
|
-
$
|
|
39
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
40
|
+
$token: theme.spacing-token-suffix($key);
|
|
41
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
40
42
|
|
|
41
|
-
.m-#{$bp}-#{$
|
|
43
|
+
.m-#{$bp}-#{$suffix} {
|
|
42
44
|
margin: $spacing;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
.p-#{$bp}-#{$
|
|
47
|
+
.p-#{$bp}-#{$suffix} {
|
|
46
48
|
padding: $spacing;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
51
|
-
$
|
|
53
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
54
|
+
$token: theme.spacing-token-suffix($key);
|
|
55
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
52
56
|
|
|
53
|
-
.mx-#{$bp}-#{$
|
|
57
|
+
.mx-#{$bp}-#{$suffix} {
|
|
54
58
|
margin-left: $spacing;
|
|
55
59
|
margin-right: $spacing;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
.my-#{$bp}-#{$
|
|
62
|
+
.my-#{$bp}-#{$suffix} {
|
|
59
63
|
margin-top: $spacing;
|
|
60
64
|
margin-bottom: $spacing;
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
.px-#{$bp}-#{$
|
|
67
|
+
.px-#{$bp}-#{$suffix} {
|
|
64
68
|
padding-left: $spacing;
|
|
65
69
|
padding-right: $spacing;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
.py-#{$bp}-#{$
|
|
72
|
+
.py-#{$bp}-#{$suffix} {
|
|
69
73
|
padding-top: $spacing;
|
|
70
74
|
padding-bottom: $spacing;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
75
|
-
$
|
|
79
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
80
|
+
$token: theme.spacing-token-suffix($key);
|
|
81
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
82
|
+
|
|
83
|
+
.space-x-#{$bp}-#{$suffix} > :where(* + *) {
|
|
84
|
+
margin-inline-start: $spacing;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.space-y-#{$bp}-#{$suffix} > :where(* + *) {
|
|
88
|
+
margin-block-start: $spacing;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
93
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
94
|
+
$token: theme.spacing-token-suffix($key);
|
|
95
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
76
96
|
|
|
77
97
|
@each $dir, $prop in map.get(theme.$theme, directions) {
|
|
78
|
-
.m#{$dir}-#{$bp}-#{$
|
|
98
|
+
.m#{$dir}-#{$bp}-#{$suffix} {
|
|
79
99
|
margin-#{$prop}: $spacing;
|
|
80
100
|
}
|
|
81
101
|
|
|
82
|
-
.p#{$dir}-#{$bp}-#{$
|
|
102
|
+
.p#{$dir}-#{$bp}-#{$suffix} {
|
|
83
103
|
padding-#{$prop}: $spacing;
|
|
84
104
|
}
|
|
85
105
|
}
|
package/scss/spacings.scss
CHANGED
|
@@ -36,51 +36,71 @@
|
|
|
36
36
|
// margin / padding spacings
|
|
37
37
|
// i.e. .m-2, .m-5, p-1,
|
|
38
38
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
39
|
-
$
|
|
39
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
40
|
+
$token: theme.spacing-token-suffix($key);
|
|
41
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
40
42
|
|
|
41
|
-
.m-#{$
|
|
43
|
+
.m-#{$suffix} {
|
|
42
44
|
margin: $spacing;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
.p-#{$
|
|
47
|
+
.p-#{$suffix} {
|
|
46
48
|
padding: $spacing;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
50
|
-
$
|
|
52
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
53
|
+
$token: theme.spacing-token-suffix($key);
|
|
54
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
51
55
|
|
|
52
|
-
.mx-#{$
|
|
56
|
+
.mx-#{$suffix} {
|
|
53
57
|
margin-left: $spacing;
|
|
54
58
|
margin-right: $spacing;
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
.my-#{$
|
|
61
|
+
.my-#{$suffix} {
|
|
58
62
|
margin-top: $spacing;
|
|
59
63
|
margin-bottom: $spacing;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
|
-
.px-#{$
|
|
66
|
+
.px-#{$suffix} {
|
|
63
67
|
padding-left: $spacing;
|
|
64
68
|
padding-right: $spacing;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
.py-#{$
|
|
71
|
+
.py-#{$suffix} {
|
|
68
72
|
padding-top: $spacing;
|
|
69
73
|
padding-bottom: $spacing;
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
|
|
77
|
+
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
78
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
79
|
+
$token: theme.spacing-token-suffix($key);
|
|
80
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
81
|
+
|
|
82
|
+
.space-x-#{$suffix} > :where(* + *) {
|
|
83
|
+
margin-inline-start: $spacing;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.space-y-#{$suffix} > :where(* + *) {
|
|
87
|
+
margin-block-start: $spacing;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
73
91
|
// margin / padding with directions
|
|
74
92
|
// i.e. mt-2, mb-5, pt-1, ...
|
|
75
93
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
76
|
-
$
|
|
94
|
+
$suffix: theme.spacing-selector-suffix($key);
|
|
95
|
+
$token: theme.spacing-token-suffix($key);
|
|
96
|
+
$spacing: var(--spacer-#{$token}, #{$value});
|
|
77
97
|
|
|
78
98
|
@each $dir, $prop in map.get(theme.$theme, directions) {
|
|
79
|
-
.m#{$dir}-#{$
|
|
99
|
+
.m#{$dir}-#{$suffix} {
|
|
80
100
|
margin-#{$prop}: $spacing;
|
|
81
101
|
}
|
|
82
102
|
|
|
83
|
-
.p#{$dir}-#{$
|
|
103
|
+
.p#{$dir}-#{$suffix} {
|
|
84
104
|
padding-#{$prop}: $spacing;
|
|
85
105
|
}
|
|
86
106
|
}
|
package/scss/theme.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use 'sass:string';
|
|
2
3
|
|
|
3
4
|
$-spacer: 1rem;
|
|
4
5
|
|
|
@@ -101,13 +102,37 @@ $-directions: (
|
|
|
101
102
|
|
|
102
103
|
$-spacings: (
|
|
103
104
|
0: 0,
|
|
105
|
+
0.5: $-spacer * 0.125,
|
|
104
106
|
1: $-spacer * 0.25,
|
|
107
|
+
1.5: $-spacer * 0.375,
|
|
105
108
|
2: $-spacer * 0.5,
|
|
109
|
+
2.5: $-spacer * 0.75,
|
|
106
110
|
3: $-spacer,
|
|
111
|
+
3.5: $-spacer * 1.25,
|
|
107
112
|
4: $-spacer * 1.5,
|
|
113
|
+
4.5: $-spacer * 2.25,
|
|
108
114
|
5: $-spacer * 3, // add auto
|
|
109
115
|
);
|
|
110
116
|
|
|
117
|
+
@function -replace($value, $search, $replacement) {
|
|
118
|
+
$index: string.index($value, $search);
|
|
119
|
+
|
|
120
|
+
@if $index {
|
|
121
|
+
@return string.slice($value, 1, $index - 1) + $replacement +
|
|
122
|
+
-replace(string.slice($value, $index + string.length($search)), $search, $replacement);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@return $value;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@function spacing-token-suffix($key) {
|
|
129
|
+
@return -replace('#{$key}', '.', '-');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@function spacing-selector-suffix($key) {
|
|
133
|
+
@return string.unquote(-replace('#{$key}', '.', '\\.'));
|
|
134
|
+
}
|
|
135
|
+
|
|
111
136
|
$-positions: (relative, absolute, fixed, static, sticky, inherit, initial, unset);
|
|
112
137
|
|
|
113
138
|
$-z-index-levels: (
|