@cocso-ui/css 1.0.0 → 1.1.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/README.md +20 -0
- package/package.json +1 -1
- package/tailwind4.css +2 -0
- package/theme-dark.css +69 -0
- package/token.css +2 -0
package/README.md
CHANGED
|
@@ -19,3 +19,23 @@ import '@cocso-ui/css/token.css';
|
|
|
19
19
|
// tailwindcss4 유틸리티 토큰
|
|
20
20
|
import '@cocso-ui/css/tailwind4.css';
|
|
21
21
|
```
|
|
22
|
+
|
|
23
|
+
### Dark theme (opt-in)
|
|
24
|
+
|
|
25
|
+
`theme-dark.css`는 시맨틱 토큰만 다크 톤으로 재매핑하는 opt-in 다크 테마입니다.
|
|
26
|
+
`token.css` **다음에** import하고, 다크로 표시할 컨테이너(보통 `<html>`)에
|
|
27
|
+
`data-theme="dark"`를 지정하세요.
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
import '@cocso-ui/css/token.css';
|
|
31
|
+
import '@cocso-ui/css/theme-dark.css';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<html data-theme="dark">
|
|
36
|
+
...
|
|
37
|
+
</html>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
원시 색상 스케일 토큰(`--cocso-color-neutral-*` 등)은 변경되지 않으므로, 앱에서
|
|
41
|
+
스케일을 오버라이드했다면 그대로 유지됩니다.
|
package/package.json
CHANGED
package/tailwind4.css
CHANGED
|
@@ -121,6 +121,8 @@
|
|
|
121
121
|
--z-index-overlay: var(--cocso-z-index-overlay);
|
|
122
122
|
--z-index-dialog: var(--cocso-z-index-dialog);
|
|
123
123
|
--z-index-dialog-content: var(--cocso-z-index-dialog-content);
|
|
124
|
+
--z-index-popover: var(--cocso-z-index-popover);
|
|
125
|
+
--z-index-tooltip: var(--cocso-z-index-tooltip);
|
|
124
126
|
--color-alpha-shadow1: var(--cocso-color-alpha-shadow1);
|
|
125
127
|
--color-alpha-shadow2: var(--cocso-color-alpha-shadow2);
|
|
126
128
|
--color-alpha-shadow3: var(--cocso-color-alpha-shadow3);
|
package/theme-dark.css
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in dark theme for @cocso-ui.
|
|
3
|
+
*
|
|
4
|
+
* Import AFTER `token.css` and set `data-theme="dark"` on a container
|
|
5
|
+
* (typically <html>):
|
|
6
|
+
*
|
|
7
|
+
* import "@cocso-ui/css/token.css";
|
|
8
|
+
* import "@cocso-ui/css/theme-dark.css";
|
|
9
|
+
*
|
|
10
|
+
* <html data-theme="dark"> … </html>
|
|
11
|
+
*
|
|
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 base colors (the
|
|
16
|
+
* `-500` feedback/interactive values) are kept as-is since they read well on a
|
|
17
|
+
* dark surface.
|
|
18
|
+
*/
|
|
19
|
+
[data-theme="dark"] {
|
|
20
|
+
/* Text */
|
|
21
|
+
--cocso-color-text-primary: var(--cocso-color-neutral-50);
|
|
22
|
+
--cocso-color-text-secondary: var(--cocso-color-neutral-400);
|
|
23
|
+
--cocso-color-text-tertiary: var(--cocso-color-neutral-500);
|
|
24
|
+
--cocso-color-text-disabled: var(--cocso-color-neutral-600);
|
|
25
|
+
--cocso-color-text-on-primary: var(--cocso-color-neutral-950);
|
|
26
|
+
--cocso-color-text-muted: var(--cocso-color-neutral-500);
|
|
27
|
+
|
|
28
|
+
/* Surface */
|
|
29
|
+
--cocso-color-surface-primary: var(--cocso-color-neutral-950);
|
|
30
|
+
--cocso-color-surface-secondary: var(--cocso-color-neutral-900);
|
|
31
|
+
--cocso-color-surface-inverse: var(--cocso-color-white);
|
|
32
|
+
--cocso-color-surface-neutral: var(--cocso-color-neutral-800);
|
|
33
|
+
|
|
34
|
+
/* Border */
|
|
35
|
+
--cocso-color-border-primary: var(--cocso-color-neutral-800);
|
|
36
|
+
--cocso-color-border-secondary: var(--cocso-color-neutral-900);
|
|
37
|
+
|
|
38
|
+
/* Interactive — primary (derived from the neutral scale) */
|
|
39
|
+
--cocso-color-interactive-primary: var(--cocso-color-primary-50);
|
|
40
|
+
--cocso-color-interactive-primary-hover: var(--cocso-color-primary-200);
|
|
41
|
+
--cocso-color-interactive-primary-active: var(--cocso-color-primary-300);
|
|
42
|
+
--cocso-color-interactive-primary-muted: var(--cocso-color-primary-500);
|
|
43
|
+
|
|
44
|
+
/* Interactive — secondary (neutral) */
|
|
45
|
+
--cocso-color-interactive-secondary: var(--cocso-color-neutral-800);
|
|
46
|
+
--cocso-color-interactive-secondary-hover: var(--cocso-color-neutral-700);
|
|
47
|
+
|
|
48
|
+
/* Focus ring */
|
|
49
|
+
--cocso-color-focus-ring: var(--cocso-color-primary-50);
|
|
50
|
+
|
|
51
|
+
/* Feedback surfaces — flip the light tints/text/borders for dark backgrounds */
|
|
52
|
+
--cocso-color-feedback-danger-subtle: var(--cocso-color-danger-950);
|
|
53
|
+
--cocso-color-feedback-danger-text: var(--cocso-color-danger-300);
|
|
54
|
+
--cocso-color-feedback-danger-border: var(--cocso-color-danger-800);
|
|
55
|
+
--cocso-color-feedback-success-subtle: var(--cocso-color-success-950);
|
|
56
|
+
--cocso-color-feedback-success-text: var(--cocso-color-success-300);
|
|
57
|
+
--cocso-color-feedback-success-border: var(--cocso-color-success-800);
|
|
58
|
+
--cocso-color-feedback-warning-subtle: var(--cocso-color-warning-950);
|
|
59
|
+
--cocso-color-feedback-warning-text: var(--cocso-color-warning-300);
|
|
60
|
+
--cocso-color-feedback-warning-border: var(--cocso-color-warning-800);
|
|
61
|
+
--cocso-color-feedback-info-subtle: var(--cocso-color-info-950);
|
|
62
|
+
--cocso-color-feedback-info-text: var(--cocso-color-info-300);
|
|
63
|
+
--cocso-color-feedback-info-border: var(--cocso-color-info-800);
|
|
64
|
+
|
|
65
|
+
/* Elevation reads stronger on dark surfaces */
|
|
66
|
+
--cocso-color-alpha-shadow1: rgba(0, 0, 0, 0.24);
|
|
67
|
+
--cocso-color-alpha-shadow2: rgba(0, 0, 0, 0.36);
|
|
68
|
+
--cocso-color-alpha-shadow3: rgba(0, 0, 0, 0.48);
|
|
69
|
+
}
|
package/token.css
CHANGED
|
@@ -144,6 +144,8 @@
|
|
|
144
144
|
--cocso-z-index-overlay: 100;
|
|
145
145
|
--cocso-z-index-dialog: 200;
|
|
146
146
|
--cocso-z-index-dialog-content: 250;
|
|
147
|
+
--cocso-z-index-popover: 300;
|
|
148
|
+
--cocso-z-index-tooltip: 400;
|
|
147
149
|
--cocso-color-alpha-shadow1: rgba(0, 0, 0, 0.04);
|
|
148
150
|
--cocso-color-alpha-shadow2: rgba(0, 0, 0, 0.08);
|
|
149
151
|
--cocso-color-alpha-shadow3: rgba(0, 0, 0, 0.12);
|