@oardi/css-utils 0.112.0 → 0.113.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/gap-responsive.scss +6 -4
- package/scss/gap.scss +6 -4
- 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
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
|
}
|
|
@@ -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: (
|