@oardi/css-utils 0.135.0 → 1.0.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/css-utils-manifest.json +10 -12
- package/css-utils-reference.md +11 -14
- package/migration-v1.md +91 -0
- package/package.json +2 -1
- package/readme.md +1 -0
- package/scss/components/range-slider.scss +1 -1
- package/scss/components/skeleton.scss +1 -1
- package/scss/components/stepper.scss +2 -2
- package/scss/text.scss +1 -18
- package/scss/theme.scss +7 -18
- package/scss/variables.scss +0 -5
package/css-utils-manifest.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@oardi/css-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"breakpoints": { "sm": "576px", "md": "768px", "lg": "992px", "xl": "1200px", "xxl": "1400px" },
|
|
5
5
|
"lifecycle": {
|
|
6
|
-
"deprecated": [
|
|
6
|
+
"deprecated": [],
|
|
7
|
+
"removed": [
|
|
7
8
|
{
|
|
8
9
|
"pattern": "lh-{value}",
|
|
9
10
|
"values": ["xs", "sm", "md", "lg", "xl", "xxl", "xxxl"],
|
|
10
11
|
"deprecatedIn": "0.123.0",
|
|
11
|
-
"
|
|
12
|
+
"removedIn": "1.0.0",
|
|
12
13
|
"replacements": {
|
|
13
14
|
"lh-xs": "line-height-none",
|
|
14
15
|
"lh-sm": "line-height-tight",
|
|
@@ -23,12 +24,10 @@
|
|
|
23
24
|
"pattern": "letter-space-{value}",
|
|
24
25
|
"values": ["0", "1", "2", "3", "4", "5"],
|
|
25
26
|
"deprecatedIn": "0.130.0",
|
|
26
|
-
"
|
|
27
|
+
"removedIn": "1.0.0",
|
|
27
28
|
"replacement": "letter-spacing-{effect}",
|
|
28
29
|
"note": "Choose an effect intentionally; the relative scale is not a visual alias for the pixel scale."
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"removed": [
|
|
30
|
+
},
|
|
32
31
|
{
|
|
33
32
|
"pattern": "active",
|
|
34
33
|
"deprecatedIn": "0.53.0",
|
|
@@ -70,15 +69,10 @@
|
|
|
70
69
|
},
|
|
71
70
|
"Text / colors": {
|
|
72
71
|
"families": [
|
|
73
|
-
{ "patterns": ["letter-space-{value}"], "values": ["0", "1", "2", "3", "4", "5"] },
|
|
74
72
|
{
|
|
75
73
|
"patterns": ["letter-spacing-{value}"],
|
|
76
74
|
"values": ["normal", "tight", "wide", "wider", "widest"]
|
|
77
75
|
},
|
|
78
|
-
{
|
|
79
|
-
"patterns": ["lh-{value}", "text-{breakpoint}-{value}"],
|
|
80
|
-
"values": ["lg", "md", "sm", "xl", "xs", "xxl", "xxxl"]
|
|
81
|
-
},
|
|
82
76
|
{
|
|
83
77
|
"patterns": ["line-height-{value}"],
|
|
84
78
|
"values": ["loose", "none", "normal", "relaxed", "snug", "tight"]
|
|
@@ -111,6 +105,10 @@
|
|
|
111
105
|
"patterns": ["text-underline-{value}"],
|
|
112
106
|
"values": ["accent", "error", "primary", "secondary", "success", "warning"]
|
|
113
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"patterns": ["text-{breakpoint}-{value}"],
|
|
110
|
+
"values": ["lg", "md", "sm", "xl", "xs", "xxl", "xxxl"]
|
|
111
|
+
},
|
|
114
112
|
{
|
|
115
113
|
"patterns": ["text-{value}"],
|
|
116
114
|
"values": [
|
package/css-utils-reference.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> Generated automatically. Do not edit manually.
|
|
4
4
|
|
|
5
5
|
- Package: `@oardi/css-utils`
|
|
6
|
-
- Version: `0.
|
|
6
|
+
- Version: `1.0.0`
|
|
7
7
|
- Source: public SCSS entry point and utility configuration
|
|
8
8
|
|
|
9
9
|
## Usage guidance
|
|
@@ -20,10 +20,12 @@ Deprecated classes are still emitted and remain listed in the current API groups
|
|
|
20
20
|
|
|
21
21
|
### Deprecated
|
|
22
22
|
|
|
23
|
+
### Removed
|
|
24
|
+
|
|
23
25
|
- `lh-{value}`
|
|
24
26
|
- Values: `xs` | `sm` | `md` | `lg` | `xl` | `xxl` | `xxxl`
|
|
25
27
|
- Deprecated in: `0.123.0`
|
|
26
|
-
-
|
|
28
|
+
- Removed in: `1.0.0`
|
|
27
29
|
- Replacements:
|
|
28
30
|
- `lh-xs` -> `line-height-none`
|
|
29
31
|
- `lh-sm` -> `line-height-tight`
|
|
@@ -32,15 +34,15 @@ Deprecated classes are still emitted and remain listed in the current API groups
|
|
|
32
34
|
- `lh-xl` -> `line-height-relaxed`
|
|
33
35
|
- `lh-xxl` -> `line-height-loose`
|
|
34
36
|
- `lh-xxxl` -> `line-height-extra-loose`
|
|
37
|
+
- Availability: not emitted by the current package
|
|
35
38
|
|
|
36
39
|
- `letter-space-{value}`
|
|
37
40
|
- Values: `0` | `1` | `2` | `3` | `4` | `5`
|
|
38
41
|
- Deprecated in: `0.130.0`
|
|
39
|
-
-
|
|
42
|
+
- Removed in: `1.0.0`
|
|
40
43
|
- Replacement: `letter-spacing-{effect}`
|
|
41
44
|
- Note: Choose an effect intentionally; the relative scale is not a visual alias for the pixel scale.
|
|
42
|
-
|
|
43
|
-
### Removed
|
|
45
|
+
- Availability: not emitted by the current package
|
|
44
46
|
|
|
45
47
|
- `active`
|
|
46
48
|
- Deprecated in: `0.53.0`
|
|
@@ -93,19 +95,10 @@ Classes:
|
|
|
93
95
|
|
|
94
96
|
## Text / colors
|
|
95
97
|
|
|
96
|
-
Values: `0` | `1` | `2` | `3` | `4` | `5`
|
|
97
|
-
|
|
98
|
-
- `letter-space-{value}`
|
|
99
|
-
|
|
100
98
|
Values: `normal` | `tight` | `wide` | `wider` | `widest`
|
|
101
99
|
|
|
102
100
|
- `letter-spacing-{value}`
|
|
103
101
|
|
|
104
|
-
Values: `lg` | `md` | `sm` | `xl` | `xs` | `xxl` | `xxxl`
|
|
105
|
-
|
|
106
|
-
- `lh-{value}`
|
|
107
|
-
- `text-{breakpoint}-{value}`
|
|
108
|
-
|
|
109
102
|
Values: `loose` | `none` | `normal` | `relaxed` | `snug` | `tight`
|
|
110
103
|
|
|
111
104
|
- `line-height-{value}`
|
|
@@ -118,6 +111,10 @@ Values: `accent` | `error` | `primary` | `secondary` | `success` | `warning`
|
|
|
118
111
|
|
|
119
112
|
- `text-underline-{value}`
|
|
120
113
|
|
|
114
|
+
Values: `lg` | `md` | `sm` | `xl` | `xs` | `xxl` | `xxxl`
|
|
115
|
+
|
|
116
|
+
- `text-{breakpoint}-{value}`
|
|
117
|
+
|
|
121
118
|
Values: `accent` | `black` | `body` | `capitalize` | `center` | `end` | `error` | `inherit` | `inverse` | `lg` | `md` | `muted` | `primary` | `secondary` | `sm` | `start` | `subtle` | `success` | `uppercase` | `warning` | `white` | `xl` | `xs` | `xxl` | `xxxl`
|
|
122
119
|
|
|
123
120
|
- `text-{value}`
|
package/migration-v1.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Migrating to CSS Utils 1.0.0
|
|
2
|
+
|
|
3
|
+
Version 1.0.0 removes the deprecated typography compatibility API. Update your markup, CSS-variable overrides and Sass configuration before upgrading from 0.x. The effect-based default values, base font sizes, responsive font-size utilities and semantic heading styles are unchanged.
|
|
4
|
+
|
|
5
|
+
## Line height
|
|
6
|
+
|
|
7
|
+
Replace the removed classes and size-based CSS tokens with their effect-based counterparts:
|
|
8
|
+
|
|
9
|
+
| Removed class | Replacement | Removed token | Replacement token | Default |
|
|
10
|
+
| ------------- | -------------------------- | -------------------- | --------------------------- | ------- |
|
|
11
|
+
| `.lh-xs` | `.line-height-none` | `--line-height-xs` | `--line-height-none` | `1` |
|
|
12
|
+
| `.lh-sm` | `.line-height-tight` | `--line-height-sm` | `--line-height-tight` | `1.125` |
|
|
13
|
+
| `.lh-md` | `.line-height-snug` | `--line-height-md` | `--line-height-snug` | `1.25` |
|
|
14
|
+
| `.lh-lg` | `.line-height-normal` | `--line-height-lg` | `--line-height-normal` | `1.5` |
|
|
15
|
+
| `.lh-xl` | `.line-height-relaxed` | `--line-height-xl` | `--line-height-relaxed` | `1.75` |
|
|
16
|
+
| `.lh-xxl` | `.line-height-loose` | `--line-height-xxl` | `--line-height-loose` | `2` |
|
|
17
|
+
| `.lh-xxxl` | `.line-height-extra-loose` | `--line-height-xxxl` | `--line-height-extra-loose` | `2.5` |
|
|
18
|
+
|
|
19
|
+
The global `--line-height` token remains unchanged. Range Slider marks, Stepper labels/status and Skeleton text placeholders now use `--line-height-tight`; migrate any old `--line-height-sm` overrides intended to customize those components.
|
|
20
|
+
|
|
21
|
+
### Sass configuration
|
|
22
|
+
|
|
23
|
+
The `lineHeights` theme map keeps its name and now uses effect names directly. Rename its keys using the same mapping above, including any `map.get()` calls in your own Sass. The intermediate public `$line-height-effect-names` map has been removed.
|
|
24
|
+
|
|
25
|
+
Before:
|
|
26
|
+
|
|
27
|
+
```scss
|
|
28
|
+
@use '@oardi/css-utils/theme' with (
|
|
29
|
+
$theme: (
|
|
30
|
+
lineHeights: (
|
|
31
|
+
sm: 1.2,
|
|
32
|
+
),
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
@use '@oardi/css-utils';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
After:
|
|
39
|
+
|
|
40
|
+
```scss
|
|
41
|
+
@use '@oardi/css-utils/theme' with (
|
|
42
|
+
$theme: (
|
|
43
|
+
lineHeights: (
|
|
44
|
+
tight: 1.2,
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
@use '@oardi/css-utils';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Import and configure the theme before any CSS Utils entry point that uses it. The theme import itself emits no CSS. The Dart Sass CLI uses the same imports with a `pkg:` prefix and `--pkg-importer=node`.
|
|
52
|
+
|
|
53
|
+
Custom keys are supported: `lineHeights: (compact: 1.1)` adds `--line-height-compact` and `.line-height-compact`. Existing defaults are retained through the theme's deep merge. Old size keys are no longer aliases for effect names; leaving `sm` in your configuration does not customize `tight`.
|
|
54
|
+
|
|
55
|
+
## Letter spacing
|
|
56
|
+
|
|
57
|
+
The `.letter-space-0` through `.letter-space-5` classes and the public `$letterSpacings` list from the `text` Sass module have been removed. Use the existing `letterSpacings` **theme map** and `.letter-spacing-{effect}` utilities instead.
|
|
58
|
+
|
|
59
|
+
| Class | Default |
|
|
60
|
+
| ------------------------ | ---------- |
|
|
61
|
+
| `.letter-spacing-tight` | `-0.025em` |
|
|
62
|
+
| `.letter-spacing-normal` | `0` |
|
|
63
|
+
| `.letter-spacing-wide` | `0.025em` |
|
|
64
|
+
| `.letter-spacing-wider` | `0.05em` |
|
|
65
|
+
| `.letter-spacing-widest` | `0.1em` |
|
|
66
|
+
|
|
67
|
+
`.letter-space-0` can become `.letter-spacing-normal` with the default theme. For the old positive pixel values, choose an effect deliberately: the relative scale changes with font size and is not a visual alias for `1px` through `5px`.
|
|
68
|
+
|
|
69
|
+
To preserve a specific pixel value, define a custom theme key instead:
|
|
70
|
+
|
|
71
|
+
```scss
|
|
72
|
+
@use '@oardi/css-utils/theme' with (
|
|
73
|
+
$theme: (
|
|
74
|
+
letterSpacings: (
|
|
75
|
+
label: 2px,
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
@use '@oardi/css-utils';
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This generates `.letter-spacing-label` and `--letter-spacing-label: 2px`. Alternatively, override an existing token where needed, for example `--letter-spacing-wide: 2px` on a specific element. Review tracking at small and large font sizes when adopting the relative defaults.
|
|
83
|
+
|
|
84
|
+
## Upgrade checks
|
|
85
|
+
|
|
86
|
+
- Search application markup and generated class names for `lh-` and `letter-space-` utilities.
|
|
87
|
+
- Search styles and inline overrides for the removed size-based `--line-height-*` tokens.
|
|
88
|
+
- Rename old `lineHeights` Sass keys and replace direct uses of `$line-height-effect-names` and the `text` module's `$letterSpacings` list.
|
|
89
|
+
- Compile your application's SCSS and check typography, Range Slider, Stepper and Skeleton views with your theme overrides.
|
|
90
|
+
|
|
91
|
+
The package's `css-utils-manifest.json` and `css-utils-reference.md` record the removed utility families with `removedIn: 1.0.0` and their replacements. All other public entry points keep their existing paths; the package continues to ship SCSS without a JavaScript runtime.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oardi/css-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"author": "Ardian Shala",
|
|
5
5
|
"homepage": "https://css-utils.oardi.com",
|
|
6
6
|
"description": "Powerful set of semantic css classes with support for breakpoints, directions and spacings",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"scss",
|
|
39
39
|
"css-utils-reference.md",
|
|
40
40
|
"css-utils-manifest.json",
|
|
41
|
+
"migration-v1.md",
|
|
41
42
|
"LICENSE.md"
|
|
42
43
|
],
|
|
43
44
|
"license": "MIT",
|
package/readme.md
CHANGED
|
@@ -162,6 +162,7 @@ Component tokens can be changed locally without affecting the rest of the interf
|
|
|
162
162
|
|
|
163
163
|
## Learn more
|
|
164
164
|
|
|
165
|
+
- [Migration from 0.x to 1.0.0](migration-v1.md)
|
|
165
166
|
- [Full documentation and showcase](https://css-utils.oardi.com/)
|
|
166
167
|
- [Get-started guide](https://css-utils.oardi.com/get-started)
|
|
167
168
|
- [Utilities, components and design tokens](https://css-utils.oardi.com/utilities/core-concepts)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
--skeleton-height: 1rem;
|
|
7
7
|
--skeleton-size: 2.5rem;
|
|
8
8
|
--skeleton-font-size: var(--font-size);
|
|
9
|
-
--skeleton-line-height: var(--line-height-
|
|
9
|
+
--skeleton-line-height: var(--line-height-tight);
|
|
10
10
|
--skeleton-control-height: 2.5rem;
|
|
11
11
|
--skeleton-aspect-ratio: auto;
|
|
12
12
|
--skeleton-border-radius: var(--border-radius-sm);
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
display: block;
|
|
101
101
|
color: var(--stepper-color);
|
|
102
102
|
font-weight: 700;
|
|
103
|
-
line-height: var(--line-height-
|
|
103
|
+
line-height: var(--line-height-tight);
|
|
104
104
|
text-decoration-thickness: 0.08em;
|
|
105
105
|
text-underline-offset: 0.18em;
|
|
106
106
|
}
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
margin-block-start: var(--spacer-1);
|
|
111
111
|
color: var(--stepper-muted-color);
|
|
112
112
|
font-size: var(--font-size-sm);
|
|
113
|
-
line-height: var(--line-height-
|
|
113
|
+
line-height: var(--line-height-tight);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
.stepper-item.is-completed {
|
package/scss/text.scss
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
@use './layers.scss';
|
|
3
3
|
@use './theme.scss' as theme;
|
|
4
4
|
|
|
5
|
-
// Deprecated: retained for the existing pixel-based utilities.
|
|
6
|
-
$letterSpacings: 0, 1, 2, 3, 4, 5;
|
|
7
|
-
|
|
8
5
|
@layer utilities {
|
|
9
6
|
.text-center {
|
|
10
7
|
text-align: center;
|
|
@@ -97,29 +94,15 @@ $letterSpacings: 0, 1, 2, 3, 4, 5;
|
|
|
97
94
|
}
|
|
98
95
|
}
|
|
99
96
|
|
|
100
|
-
// Deprecated: use .line-height-* utilities instead.
|
|
101
97
|
@each $name, $value in map.get(theme.$theme, lineHeights) {
|
|
102
|
-
.
|
|
98
|
+
.line-height-#{$name} {
|
|
103
99
|
line-height: var(--line-height-#{$name});
|
|
104
100
|
}
|
|
105
101
|
}
|
|
106
102
|
|
|
107
|
-
@each $effect, $legacy-name in theme.$line-height-effect-names {
|
|
108
|
-
.line-height-#{$effect} {
|
|
109
|
-
line-height: var(--line-height-#{$effect});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
103
|
@each $name, $value in map.get(theme.$theme, letterSpacings) {
|
|
114
104
|
.letter-spacing-#{$name} {
|
|
115
105
|
letter-spacing: var(--letter-spacing-#{$name});
|
|
116
106
|
}
|
|
117
107
|
}
|
|
118
|
-
|
|
119
|
-
// Deprecated: use .letter-spacing-* utilities instead.
|
|
120
|
-
@each $letterSpacing in $letterSpacings {
|
|
121
|
-
.letter-space-#{$letterSpacing} {
|
|
122
|
-
letter-spacing: #{$letterSpacing}px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
108
|
}
|
package/scss/theme.scss
CHANGED
|
@@ -169,24 +169,13 @@ $-breakpoints: (
|
|
|
169
169
|
);
|
|
170
170
|
|
|
171
171
|
$-line-heights: (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
// Map the public effect names to the existing Sass scale during the compatibility period.
|
|
182
|
-
$line-height-effect-names: (
|
|
183
|
-
none: xs,
|
|
184
|
-
tight: sm,
|
|
185
|
-
snug: md,
|
|
186
|
-
normal: lg,
|
|
187
|
-
relaxed: xl,
|
|
188
|
-
loose: xxl,
|
|
189
|
-
extra-loose: xxxl,
|
|
172
|
+
none: 1,
|
|
173
|
+
tight: 1.125,
|
|
174
|
+
snug: 1.25,
|
|
175
|
+
normal: 1.5,
|
|
176
|
+
relaxed: 1.75,
|
|
177
|
+
loose: 2,
|
|
178
|
+
extra-loose: 2.5,
|
|
190
179
|
);
|
|
191
180
|
|
|
192
181
|
$-letter-spacings: (
|
package/scss/variables.scss
CHANGED
|
@@ -32,11 +32,6 @@
|
|
|
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.
|
|
40
35
|
@each $name, $value in map.get(theme.$theme, lineHeights) {
|
|
41
36
|
--line-height-#{$name}: #{$value};
|
|
42
37
|
}
|