@cocso-ui/css 1.4.0 → 1.5.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/tailwind4.css +17 -14
- package/theme-dark.css +39 -70
- package/token.css +18 -15
package/package.json
CHANGED
package/tailwind4.css
CHANGED
|
@@ -123,6 +123,23 @@
|
|
|
123
123
|
--z-index-dialog-content: var(--cocso-z-index-dialog-content);
|
|
124
124
|
--z-index-popover: var(--cocso-z-index-popover);
|
|
125
125
|
--z-index-tooltip: var(--cocso-z-index-tooltip);
|
|
126
|
+
--duration-fast: var(--cocso-duration-fast);
|
|
127
|
+
--duration-normal: var(--cocso-duration-normal);
|
|
128
|
+
--duration-slow: var(--cocso-duration-slow);
|
|
129
|
+
--duration-decorative: var(--cocso-duration-decorative);
|
|
130
|
+
--duration-decorative-slow: var(--cocso-duration-decorative-slow);
|
|
131
|
+
--easing-default: var(--cocso-easing-default);
|
|
132
|
+
--easing-soft: var(--cocso-easing-soft);
|
|
133
|
+
--easing-entrance: var(--cocso-easing-entrance);
|
|
134
|
+
--easing-accordion: var(--cocso-easing-accordion);
|
|
135
|
+
--shadow-thumb: var(--cocso-shadow-thumb);
|
|
136
|
+
--shadow-card: var(--cocso-shadow-card);
|
|
137
|
+
--shadow-dropdown: var(--cocso-shadow-dropdown);
|
|
138
|
+
--shadow-popover: var(--cocso-shadow-popover);
|
|
139
|
+
--shadow-dialog: var(--cocso-shadow-dialog);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@theme {
|
|
126
143
|
--color-alpha-shadow1: var(--cocso-color-alpha-shadow1);
|
|
127
144
|
--color-alpha-shadow2: var(--cocso-color-alpha-shadow2);
|
|
128
145
|
--color-alpha-shadow3: var(--cocso-color-alpha-shadow3);
|
|
@@ -196,20 +213,6 @@
|
|
|
196
213
|
--color-feedback-info-subtle: var(--cocso-color-feedback-info-subtle);
|
|
197
214
|
--color-feedback-info-text: var(--cocso-color-feedback-info-text);
|
|
198
215
|
--color-feedback-info-border: var(--cocso-color-feedback-info-border);
|
|
199
|
-
--duration-fast: var(--cocso-duration-fast);
|
|
200
|
-
--duration-normal: var(--cocso-duration-normal);
|
|
201
|
-
--duration-slow: var(--cocso-duration-slow);
|
|
202
|
-
--duration-decorative: var(--cocso-duration-decorative);
|
|
203
|
-
--duration-decorative-slow: var(--cocso-duration-decorative-slow);
|
|
204
|
-
--easing-default: var(--cocso-easing-default);
|
|
205
|
-
--easing-soft: var(--cocso-easing-soft);
|
|
206
|
-
--easing-entrance: var(--cocso-easing-entrance);
|
|
207
|
-
--easing-accordion: var(--cocso-easing-accordion);
|
|
208
|
-
--shadow-thumb: var(--cocso-shadow-thumb);
|
|
209
|
-
--shadow-card: var(--cocso-shadow-card);
|
|
210
|
-
--shadow-dropdown: var(--cocso-shadow-dropdown);
|
|
211
|
-
--shadow-popover: var(--cocso-shadow-popover);
|
|
212
|
-
--shadow-dialog: var(--cocso-shadow-dialog);
|
|
213
216
|
}
|
|
214
217
|
|
|
215
218
|
@utility z-* { z-index: --value(--z-index-*); }
|
package/theme-dark.css
CHANGED
|
@@ -1,124 +1,93 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Opt-in dark theme for @cocso-ui.
|
|
2
|
+
* Opt-in dark theme for @cocso-ui. GENERATED — edit
|
|
3
|
+
* `packages/baseframe-sources/semantic/color.yaml` and run
|
|
4
|
+
* `pnpm --filter @cocso-ui/baseframe generate:css`.
|
|
3
5
|
*
|
|
4
|
-
* Import AFTER `token.css` and set `data-theme="dark"` on a container
|
|
5
|
-
* (typically <html>):
|
|
6
|
+
* Import AFTER `token.css` and set `data-theme="dark"` on a container:
|
|
6
7
|
*
|
|
7
8
|
* import "@cocso-ui/css/token.css";
|
|
8
9
|
* import "@cocso-ui/css/theme-dark.css";
|
|
9
10
|
*
|
|
10
11
|
* <html data-theme="dark"> … </html>
|
|
11
12
|
*
|
|
12
|
-
* Only the semantic
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the `interactive-*` fills, which keep their hue in both themes so their
|
|
18
|
-
* fixed `text-on-*` foregrounds stay valid.
|
|
13
|
+
* Only the semantic layer is here. The raw ramps stay in `token.css` and are
|
|
14
|
+
* not repeated, so an app that overrides `--cocso-color-primary-*` keeps that
|
|
15
|
+
* override in both themes. Every semantic token declares a dark value in the
|
|
16
|
+
* source, including the ones that deliberately do not move — the reasoning for
|
|
17
|
+
* each is in the YAML next to the value.
|
|
19
18
|
*/
|
|
20
19
|
[data-theme="dark"] {
|
|
21
|
-
|
|
20
|
+
--cocso-color-alpha-shadow1: rgba(0, 0, 0, 0.24);
|
|
21
|
+
--cocso-color-alpha-shadow2: rgba(0, 0, 0, 0.36);
|
|
22
|
+
--cocso-color-alpha-shadow3: rgba(0, 0, 0, 0.48);
|
|
23
|
+
--cocso-color-transparent: transparent;
|
|
22
24
|
--cocso-color-text-primary: var(--cocso-color-neutral-50);
|
|
23
25
|
--cocso-color-text-secondary: var(--cocso-color-neutral-400);
|
|
24
26
|
--cocso-color-text-tertiary: var(--cocso-color-neutral-500);
|
|
25
27
|
--cocso-color-text-disabled: var(--cocso-color-neutral-600);
|
|
26
28
|
--cocso-color-text-on-primary: var(--cocso-color-neutral-950);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
--cocso-color-text-on-success: var(--cocso-color-white);
|
|
30
|
+
--cocso-color-text-on-danger: var(--cocso-color-white);
|
|
31
|
+
--cocso-color-text-on-info: var(--cocso-color-white);
|
|
32
|
+
--cocso-color-text-on-warning: var(--cocso-color-neutral-950);
|
|
30
33
|
--cocso-color-text-muted: var(--cocso-color-neutral-500);
|
|
31
|
-
|
|
32
|
-
/* Surface */
|
|
33
34
|
--cocso-color-surface-primary: var(--cocso-color-neutral-950);
|
|
34
35
|
--cocso-color-surface-secondary: var(--cocso-color-neutral-900);
|
|
35
36
|
--cocso-color-surface-inverse: var(--cocso-color-white);
|
|
36
37
|
--cocso-color-surface-neutral: var(--cocso-color-neutral-800);
|
|
37
|
-
|
|
38
|
-
/* Border — one step lighter than the surface they sit on, mirroring the light
|
|
39
|
-
theme where surfaces take the two lightest steps and borders the next two.
|
|
40
|
-
`border-secondary` was `neutral-900`, the same value as `surface-secondary`,
|
|
41
|
-
so every divider drawn on a card was invisible at 1.00:1. */
|
|
42
38
|
--cocso-color-border-primary: var(--cocso-color-neutral-700);
|
|
43
39
|
--cocso-color-border-secondary: var(--cocso-color-neutral-800);
|
|
44
|
-
/* neutral-600 would be 2.93:1 on the dark surface, under the 3:1 that
|
|
45
|
-
WCAG 1.4.11 asks of a focus indicator. */
|
|
46
40
|
--cocso-color-border-strong: var(--cocso-color-neutral-500);
|
|
47
|
-
|
|
48
|
-
/* Overlay — translucent tints that darken whatever sits under them in the
|
|
49
|
-
light theme and must lighten it here. The `black-alpha-*` primitives they
|
|
50
|
-
resolve to in the light theme are raw scale and stay black in both themes
|
|
51
|
-
by design (the Dialog scrim depends on that), so a consumer reaching for
|
|
52
|
-
`black-alpha-5` directly got a 5% black wash on a #131416 surface: an
|
|
53
|
-
invisible hover state and a hairline border that was not there. */
|
|
54
41
|
--cocso-color-overlay-subtle: var(--cocso-color-white-alpha-5);
|
|
55
42
|
--cocso-color-overlay-muted: var(--cocso-color-white-alpha-10);
|
|
56
43
|
--cocso-color-overlay-strong: var(--cocso-color-white-alpha-20);
|
|
57
|
-
|
|
58
|
-
/* Interactive — primary (derived from the neutral scale) */
|
|
59
44
|
--cocso-color-interactive-primary: var(--cocso-color-primary-50);
|
|
60
45
|
--cocso-color-interactive-primary-hover: var(--cocso-color-primary-200);
|
|
61
46
|
--cocso-color-interactive-primary-active: var(--cocso-color-primary-300);
|
|
62
47
|
--cocso-color-interactive-primary-muted: var(--cocso-color-primary-500);
|
|
63
48
|
--cocso-color-interactive-primary-subtle: var(--cocso-color-primary-900);
|
|
64
49
|
--cocso-color-interactive-primary-text: var(--cocso-color-primary-200);
|
|
65
|
-
|
|
66
|
-
/* Interactive — secondary (neutral) */
|
|
67
50
|
--cocso-color-interactive-secondary: var(--cocso-color-neutral-800);
|
|
68
51
|
--cocso-color-interactive-secondary-hover: var(--cocso-color-neutral-700);
|
|
69
|
-
|
|
70
|
-
/* Interactive — danger tint (text/ghost destructive actions) */
|
|
71
|
-
--cocso-color-interactive-danger-subtle-hover: var(--cocso-color-danger-950);
|
|
72
|
-
--cocso-color-interactive-danger-subtle-active: var(--cocso-color-danger-900);
|
|
73
|
-
|
|
74
|
-
/* Interactive — neutral surface (quiet, low-emphasis actions) */
|
|
75
52
|
--cocso-color-interactive-neutral: var(--cocso-color-neutral-800);
|
|
76
53
|
--cocso-color-interactive-neutral-hover: var(--cocso-color-neutral-700);
|
|
77
54
|
--cocso-color-interactive-neutral-active: var(--cocso-color-neutral-600);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
55
|
+
--cocso-color-interactive-danger: var(--cocso-color-danger-500);
|
|
56
|
+
--cocso-color-interactive-danger-hover: var(--cocso-color-danger-600);
|
|
57
|
+
--cocso-color-interactive-danger-active: var(--cocso-color-danger-700);
|
|
58
|
+
--cocso-color-interactive-danger-hover-subtle: var(--cocso-color-danger-400);
|
|
59
|
+
--cocso-color-interactive-danger-subtle-hover: var(--cocso-color-danger-950);
|
|
60
|
+
--cocso-color-interactive-danger-subtle-active: var(--cocso-color-danger-900);
|
|
61
|
+
--cocso-color-interactive-success: var(--cocso-color-success-500);
|
|
62
|
+
--cocso-color-interactive-success-hover: var(--cocso-color-success-600);
|
|
63
|
+
--cocso-color-interactive-success-active: var(--cocso-color-success-700);
|
|
64
|
+
--cocso-color-interactive-success-hover-subtle: var(--cocso-color-success-400);
|
|
65
|
+
--cocso-color-interactive-warning: var(--cocso-color-warning-300);
|
|
66
|
+
--cocso-color-interactive-warning-hover: var(--cocso-color-warning-400);
|
|
67
|
+
--cocso-color-interactive-warning-active: var(--cocso-color-warning-500);
|
|
68
|
+
--cocso-color-interactive-warning-hover-subtle: var(--cocso-color-warning-400);
|
|
69
|
+
--cocso-color-interactive-info: var(--cocso-color-info-500);
|
|
70
|
+
--cocso-color-interactive-info-hover: var(--cocso-color-info-600);
|
|
71
|
+
--cocso-color-interactive-info-active: var(--cocso-color-info-700);
|
|
72
|
+
--cocso-color-interactive-info-hover-subtle: var(--cocso-color-info-400);
|
|
85
73
|
--cocso-color-interactive-info-text: var(--cocso-color-info-300);
|
|
86
74
|
--cocso-color-interactive-info-text-hover: var(--cocso-color-info-200);
|
|
87
|
-
|
|
88
|
-
/* Focus ring */
|
|
89
75
|
--cocso-color-focus-ring: var(--cocso-color-primary-50);
|
|
90
|
-
|
|
91
|
-
/* Feedback base colors — one step up the ramp. The light theme's 500 level is
|
|
92
|
-
tuned for white; on the dark `surface-primary` (#131416) it lands at
|
|
93
|
-
4.04 (danger), 4.05 (info), 3.96 (warning) and 4.03 (success), all under
|
|
94
|
-
the 4.5:1 AA needs for the body-size text that StockQuantityStatus draws
|
|
95
|
-
with them. The 400 level clears it at 5.36-5.96 without shifting hue; the
|
|
96
|
-
300 level clears it too but washes out to pastel, and a pastel red does
|
|
97
|
-
not read as "danger". `feedback-success-muted` is left at the light
|
|
98
|
-
theme's 400 and therefore coincides with `feedback-success` here: the
|
|
99
|
-
ramp has no quieter green that still clears AA at body size, and no
|
|
100
|
-
surface renders the two side by side. */
|
|
101
76
|
--cocso-color-feedback-danger: var(--cocso-color-danger-400);
|
|
102
|
-
--cocso-color-feedback-info: var(--cocso-color-info-400);
|
|
103
|
-
--cocso-color-feedback-warning: var(--cocso-color-warning-400);
|
|
104
|
-
--cocso-color-feedback-success: var(--cocso-color-success-400);
|
|
105
|
-
|
|
106
|
-
/* Feedback surfaces — flip the light tints/text/borders for dark backgrounds */
|
|
107
77
|
--cocso-color-feedback-danger-subtle: var(--cocso-color-danger-950);
|
|
108
78
|
--cocso-color-feedback-danger-text: var(--cocso-color-danger-300);
|
|
109
79
|
--cocso-color-feedback-danger-border: var(--cocso-color-danger-800);
|
|
80
|
+
--cocso-color-feedback-success: var(--cocso-color-success-400);
|
|
110
81
|
--cocso-color-feedback-success-subtle: var(--cocso-color-success-950);
|
|
111
82
|
--cocso-color-feedback-success-text: var(--cocso-color-success-300);
|
|
112
83
|
--cocso-color-feedback-success-border: var(--cocso-color-success-800);
|
|
84
|
+
--cocso-color-feedback-success-muted: var(--cocso-color-success-400);
|
|
85
|
+
--cocso-color-feedback-warning: var(--cocso-color-warning-400);
|
|
113
86
|
--cocso-color-feedback-warning-subtle: var(--cocso-color-warning-950);
|
|
114
87
|
--cocso-color-feedback-warning-text: var(--cocso-color-warning-300);
|
|
115
88
|
--cocso-color-feedback-warning-border: var(--cocso-color-warning-800);
|
|
89
|
+
--cocso-color-feedback-info: var(--cocso-color-info-400);
|
|
116
90
|
--cocso-color-feedback-info-subtle: var(--cocso-color-info-950);
|
|
117
91
|
--cocso-color-feedback-info-text: var(--cocso-color-info-300);
|
|
118
92
|
--cocso-color-feedback-info-border: var(--cocso-color-info-800);
|
|
119
|
-
|
|
120
|
-
/* Elevation reads stronger on dark surfaces */
|
|
121
|
-
--cocso-color-alpha-shadow1: rgba(0, 0, 0, 0.24);
|
|
122
|
-
--cocso-color-alpha-shadow2: rgba(0, 0, 0, 0.36);
|
|
123
|
-
--cocso-color-alpha-shadow3: rgba(0, 0, 0, 0.48);
|
|
124
93
|
}
|
package/token.css
CHANGED
|
@@ -146,6 +146,23 @@
|
|
|
146
146
|
--cocso-z-index-dialog-content: 250;
|
|
147
147
|
--cocso-z-index-popover: 300;
|
|
148
148
|
--cocso-z-index-tooltip: 400;
|
|
149
|
+
--cocso-duration-fast: 0.15s;
|
|
150
|
+
--cocso-duration-normal: 0.2s;
|
|
151
|
+
--cocso-duration-slow: 0.25s;
|
|
152
|
+
--cocso-duration-decorative: 0.75s;
|
|
153
|
+
--cocso-duration-decorative-slow: 1.5s;
|
|
154
|
+
--cocso-easing-default: ease-in-out;
|
|
155
|
+
--cocso-easing-soft: ease;
|
|
156
|
+
--cocso-easing-entrance: cubic-bezier(0.16, 1, 0.3, 1);
|
|
157
|
+
--cocso-easing-accordion: cubic-bezier(0.87, 0, 0.13, 1);
|
|
158
|
+
--cocso-shadow-thumb: var(--cocso-shadow-xs);
|
|
159
|
+
--cocso-shadow-card: var(--cocso-shadow-sm);
|
|
160
|
+
--cocso-shadow-dropdown: var(--cocso-shadow-sm);
|
|
161
|
+
--cocso-shadow-popover: var(--cocso-shadow-sm);
|
|
162
|
+
--cocso-shadow-dialog: var(--cocso-shadow-md);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:root {
|
|
149
166
|
--cocso-color-alpha-shadow1: rgba(0, 0, 0, 0.04);
|
|
150
167
|
--cocso-color-alpha-shadow2: rgba(0, 0, 0, 0.08);
|
|
151
168
|
--cocso-color-alpha-shadow3: rgba(0, 0, 0, 0.12);
|
|
@@ -199,7 +216,7 @@
|
|
|
199
216
|
--cocso-color-interactive-info-hover: var(--cocso-color-info-600);
|
|
200
217
|
--cocso-color-interactive-info-active: var(--cocso-color-info-700);
|
|
201
218
|
--cocso-color-interactive-info-hover-subtle: var(--cocso-color-info-400);
|
|
202
|
-
--cocso-color-interactive-info-text: var(--cocso-color-info-
|
|
219
|
+
--cocso-color-interactive-info-text: var(--cocso-color-info-600);
|
|
203
220
|
--cocso-color-interactive-info-text-hover: var(--cocso-color-info-700);
|
|
204
221
|
--cocso-color-focus-ring: var(--cocso-color-primary-950);
|
|
205
222
|
--cocso-color-feedback-danger: var(--cocso-color-danger-500);
|
|
@@ -219,18 +236,4 @@
|
|
|
219
236
|
--cocso-color-feedback-info-subtle: var(--cocso-color-info-50);
|
|
220
237
|
--cocso-color-feedback-info-text: var(--cocso-color-info-600);
|
|
221
238
|
--cocso-color-feedback-info-border: var(--cocso-color-info-200);
|
|
222
|
-
--cocso-duration-fast: 0.15s;
|
|
223
|
-
--cocso-duration-normal: 0.2s;
|
|
224
|
-
--cocso-duration-slow: 0.25s;
|
|
225
|
-
--cocso-duration-decorative: 0.75s;
|
|
226
|
-
--cocso-duration-decorative-slow: 1.5s;
|
|
227
|
-
--cocso-easing-default: ease-in-out;
|
|
228
|
-
--cocso-easing-soft: ease;
|
|
229
|
-
--cocso-easing-entrance: cubic-bezier(0.16, 1, 0.3, 1);
|
|
230
|
-
--cocso-easing-accordion: cubic-bezier(0.87, 0, 0.13, 1);
|
|
231
|
-
--cocso-shadow-thumb: var(--cocso-shadow-xs);
|
|
232
|
-
--cocso-shadow-card: var(--cocso-shadow-sm);
|
|
233
|
-
--cocso-shadow-dropdown: var(--cocso-shadow-sm);
|
|
234
|
-
--cocso-shadow-popover: var(--cocso-shadow-sm);
|
|
235
|
-
--cocso-shadow-dialog: var(--cocso-shadow-md);
|
|
236
239
|
}
|