@oardi/css-utils 0.26.3 → 0.27.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/package.json +1 -1
- package/readme.md +3 -2
- package/scss/spacings.scss +11 -0
- package/scss/theme.scss +5 -0
- package/scss/utilities.scss +43 -19
- package/scss/variables.scss +3 -3
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Powerful set of CSS Utility classes for Colors, Typography, Spacings, Flex and CSS Grid.
|
|
4
4
|
|
|
5
|
+
<!-- [](https://stackblitz.com/edit/oardi-css-utils/) -->
|
|
6
|
+
|
|
5
7
|
## Showcase
|
|
6
8
|
|
|
7
9
|
- Browse the Showcase [here](https://css-utils.oardi.com/)
|
|
@@ -17,11 +19,10 @@ npm i @oardi/css-utils
|
|
|
17
19
|
|
|
18
20
|
### Import SCSS files
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
Import the theme with all utility classes and their responsive classes as well as predefined components.
|
|
21
23
|
|
|
22
24
|
```scss
|
|
23
25
|
@use '@oardi/css-utilss/scss/index.scss';
|
|
24
|
-
@use '@oardi/css-utils/scss/components.scss';
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
### Use Utility classes
|
package/scss/spacings.scss
CHANGED
|
@@ -4,8 +4,18 @@
|
|
|
4
4
|
.ml-auto {
|
|
5
5
|
margin-left: auto;
|
|
6
6
|
}
|
|
7
|
+
.mr-auto {
|
|
8
|
+
margin-right: auto;
|
|
9
|
+
}
|
|
10
|
+
.mt-auto {
|
|
11
|
+
margin-top: auto;
|
|
12
|
+
}
|
|
13
|
+
.mb-auto {
|
|
14
|
+
margin-bottom: auto;
|
|
15
|
+
}
|
|
7
16
|
|
|
8
17
|
// margin / padding spacings
|
|
18
|
+
// i.e. m-2, m-5, p-1, ...
|
|
9
19
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
10
20
|
.m-#{$key} {
|
|
11
21
|
margin: $value;
|
|
@@ -17,6 +27,7 @@
|
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
// margin / padding with directions
|
|
30
|
+
// i.e. mt-2, mb-5, pt-1, ...
|
|
20
31
|
@each $key, $value in map.get(theme.$theme, spacings) {
|
|
21
32
|
@each $dir, $prop in map.get(theme.$theme, directions) {
|
|
22
33
|
.m#{$dir}-#{$key} {
|
package/scss/theme.scss
CHANGED
|
@@ -27,8 +27,12 @@ $theme: (
|
|
|
27
27
|
directions: (
|
|
28
28
|
t: top,
|
|
29
29
|
r: right,
|
|
30
|
+
// rename r to e -> end
|
|
30
31
|
b: bottom,
|
|
31
32
|
l: left,
|
|
33
|
+
// rename l to s -> start
|
|
34
|
+
// add x for left and right
|
|
35
|
+
// add y for top and bottom
|
|
32
36
|
),
|
|
33
37
|
spacings: (
|
|
34
38
|
0: 0rem,
|
|
@@ -37,6 +41,7 @@ $theme: (
|
|
|
37
41
|
3: 3rem,
|
|
38
42
|
4: 4rem,
|
|
39
43
|
5: 5rem,
|
|
44
|
+
// add auto
|
|
40
45
|
),
|
|
41
46
|
positions: (
|
|
42
47
|
relative,
|
package/scss/utilities.scss
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use './theme.scss';
|
|
3
3
|
|
|
4
|
-
.d-block {
|
|
5
|
-
display: block;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.d-inline-block {
|
|
9
|
-
display: inline-block;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.d-none {
|
|
13
|
-
display: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
4
|
// positions
|
|
17
5
|
@each $value in map.get(theme.$theme, positions) {
|
|
18
6
|
.position-#{$value} {
|
|
@@ -29,15 +17,16 @@
|
|
|
29
17
|
width: 100%;
|
|
30
18
|
}
|
|
31
19
|
|
|
20
|
+
// add responsive
|
|
32
21
|
.text-center {
|
|
33
22
|
text-align: center;
|
|
34
23
|
}
|
|
35
24
|
|
|
36
|
-
.text-
|
|
25
|
+
.text-start {
|
|
37
26
|
text-align: left;
|
|
38
27
|
}
|
|
39
28
|
|
|
40
|
-
.text-
|
|
29
|
+
.text-end {
|
|
41
30
|
text-align: right;
|
|
42
31
|
}
|
|
43
32
|
|
|
@@ -98,16 +87,24 @@ bg-light(top)?
|
|
|
98
87
|
border-radius: 50%;
|
|
99
88
|
}
|
|
100
89
|
|
|
101
|
-
.
|
|
102
|
-
|
|
90
|
+
.rounded {
|
|
91
|
+
border-radius: var(--border-radius) !important;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.shadow-none {
|
|
95
|
+
box-shadow: none !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.shadow-sm {
|
|
99
|
+
box-shadow: var(--shadow-sm) !important;
|
|
103
100
|
}
|
|
104
101
|
|
|
105
102
|
.shadow {
|
|
106
|
-
box-shadow: var(--shadow);
|
|
103
|
+
box-shadow: var(--shadow) !important;
|
|
107
104
|
}
|
|
108
105
|
|
|
109
|
-
.shadow-
|
|
110
|
-
box-shadow: var(--shadow-
|
|
106
|
+
.shadow-lg {
|
|
107
|
+
box-shadow: var(--shadow-lg) !important;
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
.w-100 {
|
|
@@ -126,11 +123,13 @@ bg-light(top)?
|
|
|
126
123
|
width: 40%;
|
|
127
124
|
}
|
|
128
125
|
|
|
126
|
+
// TODO - add several heights
|
|
129
127
|
.h-100 {
|
|
130
128
|
height: 100%;
|
|
131
129
|
}
|
|
132
130
|
|
|
133
131
|
// TODO - check if more classes are needed
|
|
132
|
+
// arrange elements top, start, bottom, end
|
|
134
133
|
.top-0 {
|
|
135
134
|
top: 0px;
|
|
136
135
|
}
|
|
@@ -192,10 +191,35 @@ bg-light(top)?
|
|
|
192
191
|
.w-#{$bp}-30 {
|
|
193
192
|
width: 30% !important;
|
|
194
193
|
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// display
|
|
198
|
+
.d-none {
|
|
199
|
+
display: none !important;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.d-block {
|
|
203
|
+
display: block !important;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.d-inline-block {
|
|
207
|
+
display: inline-block !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
|
|
211
|
+
@media (min-width: #{$bp-value}) {
|
|
212
|
+
.d-#{$bp}-none {
|
|
213
|
+
display: none !important;
|
|
214
|
+
}
|
|
195
215
|
|
|
196
216
|
.d-#{$bp}-block {
|
|
197
217
|
display: block !important;
|
|
198
218
|
}
|
|
219
|
+
|
|
220
|
+
.d-#{$bp}-inline-block {
|
|
221
|
+
display: inline-block !important;
|
|
222
|
+
}
|
|
199
223
|
}
|
|
200
224
|
}
|
|
201
225
|
|
package/scss/variables.scss
CHANGED
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
--disabled-bg-color: var(--gray-80);
|
|
34
34
|
--disabled-border-color: var(--gray-80);
|
|
35
35
|
|
|
36
|
-
--shadow: 0 0.
|
|
37
|
-
--shadow-
|
|
38
|
-
--shadow-
|
|
36
|
+
--shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
37
|
+
--shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
|
38
|
+
--shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
|
|
39
39
|
|
|
40
40
|
--focus-outline: 2px solid var(--primary-light);
|
|
41
41
|
--focus-outline-error: 2px solid var(--error-light);
|