@cocso-ui/css 1.5.0 → 1.5.2

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/README.md CHANGED
@@ -39,3 +39,26 @@ import '@cocso-ui/css/theme-dark.css';
39
39
 
40
40
  원시 색상 스케일 토큰(`--cocso-color-neutral-*` 등)은 변경되지 않으므로, 앱에서
41
41
  스케일을 오버라이드했다면 그대로 유지됩니다.
42
+
43
+ ### 본문 텍스트 색상 (WCAG AA)
44
+
45
+ 본문에 쓸 수 있는 텍스트 토큰은 `--cocso-color-text-primary`와
46
+ `--cocso-color-text-secondary` 두 단계입니다.
47
+
48
+ `--cocso-color-text-tertiary`는 **본문용이 아닙니다.** 어떤 표면 위에서도 AA
49
+ (4.5:1)를 넘지 못합니다.
50
+
51
+ | 토큰 | 흰 배경 | `surface-secondary` | 최악의 틴트 표면 |
52
+ |---|---|---|---|
53
+ | `text-primary` | 18.43 | 16.89 | 15.00 |
54
+ | `text-secondary` | 6.30 | 5.77 | 5.13 |
55
+ | `text-tertiary` | **3.08** | **2.82** | **2.51** |
56
+
57
+ 한 단계 어둡게(`neutral-500`, 4.51:1) 옮겨도 흰 배경만 통과하고 카드 위에서는
58
+ 4.13:1로 여전히 미달입니다. 흰 배경과 최악의 틴트 표면 양쪽에서 AA를 넘기는 가장
59
+ 밝은 회색은 `#686868`인데, `text-secondary`(`#58616a`)와 육안으로 구분되지
60
+ 않습니다. 세 번째 본문 단계는 이 팔레트에 자리가 좁은 것이 아니라 없습니다.
61
+
62
+ `text-tertiary`가 맞는 자리는 텍스트가 아닌 것 — 아이콘이 아닌 장식, 구분선,
63
+ 비활성 상태처럼 1.4.3이 면제하는 경우입니다. 텍스트에 시각적 위계가 필요하면
64
+ 색이 아니라 크기와 굵기로 표현하고, 색은 `text-secondary`를 쓰세요.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocso-ui/css",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cocso/cocso-ui.git",
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 token layer is remapped — raw color-scale tokens
13
- * (`--cocso-color-neutral-*`, `--cocso-color-info-*`, …) are unchanged, so
14
- * any app override of those scales is preserved. Neutral-driven tokens are
15
- * inverted along the scale (50 ↔ 950); saturated accent colors move one step
16
- * up the ramp (`-500` → `-400`) so they clear AA on the dark surface, except
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
- /* Text */
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
- /* text-on-success/-danger/-info/-warning are deliberately NOT overridden.
28
- Their fills (`interactive-success` and friends) keep the same hue in both
29
- themes, so a foreground that flipped would land light-on-light. */
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
- /* Interactive — info as text (Link). The `interactive-info` fills above keep
80
- their hue in both themes because a saturated accent reads on either
81
- surface, but Link paints *text* with them, and there the ramp runs the
82
- wrong way: on a dark surface `info-500` is 4.05:1 and the `info-700`
83
- hover state is 1.74:1, so hovering a link nearly erased it. These two
84
- carry the light theme's values unchanged and flip here. */
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);
@@ -166,7 +183,7 @@
166
183
  --cocso-color-surface-neutral: var(--cocso-color-neutral-100);
167
184
  --cocso-color-border-primary: var(--cocso-color-neutral-200);
168
185
  --cocso-color-border-secondary: var(--cocso-color-neutral-100);
169
- --cocso-color-border-strong: var(--cocso-color-neutral-400);
186
+ --cocso-color-border-strong: var(--cocso-color-neutral-500);
170
187
  --cocso-color-overlay-subtle: var(--cocso-color-black-alpha-5);
171
188
  --cocso-color-overlay-muted: var(--cocso-color-black-alpha-10);
172
189
  --cocso-color-overlay-strong: var(--cocso-color-black-alpha-20);
@@ -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
  }