@oardi/css-utils 0.122.0 → 0.124.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/readme.md +2 -2
- package/scss/text.scss +7 -0
- package/scss/theme.scss +11 -0
- package/scss/utilities.scss +61 -21
- package/scss/variables.scss +5 -0
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -4,8 +4,8 @@ CSS Utils is a lightweight SCSS toolkit with utility classes, responsive helpers
|
|
|
4
4
|
|
|
5
5
|
## What it includes
|
|
6
6
|
|
|
7
|
-
- Utilities for colors, typography, spacing, display, flex and grid
|
|
8
|
-
- Mobile-first responsive variants for layout and spacing
|
|
7
|
+
- Utilities for colors, typography, spacing, sizing, positioning, display, flex and grid
|
|
8
|
+
- Mobile-first responsive variants for layout, sizing, positioning and spacing
|
|
9
9
|
- Components for buttons, cards, forms, badges, tabs, toasts and more
|
|
10
10
|
- Global and component-specific design tokens
|
|
11
11
|
- A predefined cascade order: `reset`, `base`, `components`, then `utilities`
|
package/scss/text.scss
CHANGED
|
@@ -86,12 +86,19 @@ $letterSpacings: 0, 1, 2, 3, 4, 5;
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
// Deprecated: use .line-height-* utilities instead.
|
|
89
90
|
@each $name, $value in map.get(theme.$theme, lineHeights) {
|
|
90
91
|
.lh-#{$name} {
|
|
91
92
|
line-height: var(--line-height-#{$name});
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
@each $effect, $legacy-name in theme.$line-height-effect-names {
|
|
97
|
+
.line-height-#{$effect} {
|
|
98
|
+
line-height: var(--line-height-#{$effect});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
95
102
|
@each $letterSpacing in $letterSpacings {
|
|
96
103
|
.letter-space-#{$letterSpacing} {
|
|
97
104
|
letter-spacing: #{$letterSpacing}px;
|
package/scss/theme.scss
CHANGED
|
@@ -166,6 +166,17 @@ $-line-heights: (
|
|
|
166
166
|
xxxl: 2.5,
|
|
167
167
|
);
|
|
168
168
|
|
|
169
|
+
// Map the public effect names to the existing Sass scale during the compatibility period.
|
|
170
|
+
$line-height-effect-names: (
|
|
171
|
+
none: xs,
|
|
172
|
+
tight: sm,
|
|
173
|
+
snug: md,
|
|
174
|
+
normal: lg,
|
|
175
|
+
relaxed: xl,
|
|
176
|
+
loose: xxl,
|
|
177
|
+
extra-loose: xxxl,
|
|
178
|
+
);
|
|
179
|
+
|
|
169
180
|
$-font-sizes: (
|
|
170
181
|
xs: 0.75rem,
|
|
171
182
|
sm: 0.875rem,
|
package/scss/utilities.scss
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@use './display.scss';
|
|
5
5
|
@use './theme.scss' as theme;
|
|
6
6
|
|
|
7
|
-
$-
|
|
7
|
+
$-sizes: (
|
|
8
8
|
100: 100%,
|
|
9
9
|
75: 75%,
|
|
10
10
|
60: 60%,
|
|
@@ -15,6 +15,29 @@ $-widths: (
|
|
|
15
15
|
auto: auto,
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
+
$-insets: (
|
|
19
|
+
0: 0,
|
|
20
|
+
25: 25%,
|
|
21
|
+
50: 50%,
|
|
22
|
+
75: 75%,
|
|
23
|
+
100: 100%,
|
|
24
|
+
auto: auto,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
$-inset-properties: (
|
|
28
|
+
inset: inset,
|
|
29
|
+
inset-inline: inset-inline,
|
|
30
|
+
inset-block: inset-block,
|
|
31
|
+
inset-inline-start: inset-inline-start,
|
|
32
|
+
inset-inline-end: inset-inline-end,
|
|
33
|
+
inset-block-start: inset-block-start,
|
|
34
|
+
inset-block-end: inset-block-end,
|
|
35
|
+
top: top,
|
|
36
|
+
right: right,
|
|
37
|
+
bottom: bottom,
|
|
38
|
+
left: left,
|
|
39
|
+
);
|
|
40
|
+
|
|
18
41
|
$-overflow-wrap-values: normal, break-word, anywhere;
|
|
19
42
|
|
|
20
43
|
// Guard the dynamic value: a var() declaration can otherwise become invalid only
|
|
@@ -277,33 +300,30 @@ $-overflow-wrap-values: normal, break-word, anywhere;
|
|
|
277
300
|
min-width: 0;
|
|
278
301
|
}
|
|
279
302
|
|
|
280
|
-
@each $name, $value in $-
|
|
303
|
+
@each $name, $value in $-sizes {
|
|
281
304
|
.w-#{$name} {
|
|
282
305
|
width: $value;
|
|
283
306
|
}
|
|
284
|
-
}
|
|
285
307
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// TODO - check if more classes are needed
|
|
292
|
-
// arrange elements top, start, bottom, end
|
|
293
|
-
.top-0 {
|
|
294
|
-
top: 0px;
|
|
295
|
-
}
|
|
308
|
+
.h-#{$name} {
|
|
309
|
+
height: $value;
|
|
310
|
+
}
|
|
296
311
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
312
|
+
.inline-size-#{$name} {
|
|
313
|
+
inline-size: $value;
|
|
314
|
+
}
|
|
300
315
|
|
|
301
|
-
|
|
302
|
-
|
|
316
|
+
.block-size-#{$name} {
|
|
317
|
+
block-size: $value;
|
|
318
|
+
}
|
|
303
319
|
}
|
|
304
320
|
|
|
305
|
-
|
|
306
|
-
|
|
321
|
+
@each $name, $value in $-insets {
|
|
322
|
+
@each $class-name, $property in $-inset-properties {
|
|
323
|
+
.#{$class-name}-#{$name} {
|
|
324
|
+
#{$property}: $value;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
307
327
|
}
|
|
308
328
|
|
|
309
329
|
.fixed-top {
|
|
@@ -333,10 +353,30 @@ $-overflow-wrap-values: normal, break-word, anywhere;
|
|
|
333
353
|
// width with breakpoints
|
|
334
354
|
@each $bp, $bp-value in map.get(theme.$theme, breakpoints) {
|
|
335
355
|
@media (min-width: #{$bp-value}) {
|
|
336
|
-
@each $name, $value in $-
|
|
356
|
+
@each $name, $value in $-sizes {
|
|
337
357
|
.w-#{$bp}-#{$name} {
|
|
338
358
|
width: $value;
|
|
339
359
|
}
|
|
360
|
+
|
|
361
|
+
.h-#{$bp}-#{$name} {
|
|
362
|
+
height: $value;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.inline-size-#{$bp}-#{$name} {
|
|
366
|
+
inline-size: $value;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.block-size-#{$bp}-#{$name} {
|
|
370
|
+
block-size: $value;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
@each $name, $value in $-insets {
|
|
375
|
+
@each $class-name, $property in $-inset-properties {
|
|
376
|
+
.#{$class-name}-#{$bp}-#{$name} {
|
|
377
|
+
#{$property}: $value;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
340
380
|
}
|
|
341
381
|
}
|
|
342
382
|
}
|
package/scss/variables.scss
CHANGED
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
--line-height: 1.8;
|
|
35
|
+
@each $effect, $legacy-name in theme.$line-height-effect-names {
|
|
36
|
+
--line-height-#{$effect}: #{map.get(map.get(theme.$theme, lineHeights), $legacy-name)};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Deprecated: retained for existing .lh-* utilities and component tokens.
|
|
35
40
|
@each $name, $value in map.get(theme.$theme, lineHeights) {
|
|
36
41
|
--line-height-#{$name}: #{$value};
|
|
37
42
|
}
|