@tokis/theme 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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -0
  3. package/package.json +69 -0
  4. package/src/base/index.css +19 -0
  5. package/src/base/reset.css +76 -0
  6. package/src/base/variables.css +206 -0
  7. package/src/components/accordion.css +124 -0
  8. package/src/components/alert.css +196 -0
  9. package/src/components/app-bar.css +69 -0
  10. package/src/components/avatar.css +199 -0
  11. package/src/components/bottom-nav.css +79 -0
  12. package/src/components/button.css +213 -0
  13. package/src/components/card.css +248 -0
  14. package/src/components/charts.css +38 -0
  15. package/src/components/checkbox.css +158 -0
  16. package/src/components/circular-progress.css +62 -0
  17. package/src/components/codeblock.css +229 -0
  18. package/src/components/command-palette.css +183 -0
  19. package/src/components/confirm-dialog.css +95 -0
  20. package/src/components/context-menu.css +82 -0
  21. package/src/components/dialog.css +149 -0
  22. package/src/components/drawer.css +167 -0
  23. package/src/components/dropdown.css +33 -0
  24. package/src/components/emptystate.css +42 -0
  25. package/src/components/extended.css +663 -0
  26. package/src/components/hover-card.css +29 -0
  27. package/src/components/index.css +40 -0
  28. package/src/components/infinite-scroll.css +45 -0
  29. package/src/components/input.css +201 -0
  30. package/src/components/nav-rail.css +104 -0
  31. package/src/components/navigation.css +273 -0
  32. package/src/components/pagination.css +91 -0
  33. package/src/components/progress.css +192 -0
  34. package/src/components/result.css +58 -0
  35. package/src/components/search-field.css +102 -0
  36. package/src/components/select.css +175 -0
  37. package/src/components/slider.css +115 -0
  38. package/src/components/snackbar.css +234 -0
  39. package/src/components/statistic.css +70 -0
  40. package/src/components/stepper.css +131 -0
  41. package/src/components/switch.css +107 -0
  42. package/src/components/tabs.css +152 -0
  43. package/src/components/timeline.css +125 -0
  44. package/src/components/toggle.css +103 -0
  45. package/src/components/tooltip.css +113 -0
  46. package/src/components/treeview.css +107 -0
  47. package/src/components/virtual-list.css +19 -0
  48. package/src/index.css +6 -0
  49. package/src/utilities/index.css +2 -0
  50. package/src/utilities/layout.css +28 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tokis Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # /theme
2
+
3
+ Default visual theme for the Tokis design system — CSS variables, component styles, reset, and typography. Zero-runtime, precompiled CSS.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install /theme
9
+ ```
10
+
11
+ > Or install everything at once: `npm install tokis`
12
+
13
+ ## Usage
14
+
15
+ Import the full theme (recommended):
16
+
17
+ ```tsx
18
+ import '/theme';
19
+ ```
20
+
21
+ Or import individual layers:
22
+
23
+ ```tsx
24
+ import '/theme/base'; // Variables + reset
25
+ import '/theme/components'; // All component styles
26
+ import '/theme/utilities'; // Utility classes
27
+ ```
28
+
29
+ Or import specific component styles:
30
+
31
+ ```tsx
32
+ import '/theme/base';
33
+ import '/theme/components/button';
34
+ import '/theme/components/dialog';
35
+ ```
36
+
37
+ ## What's Included
38
+
39
+ - **CSS Variables** — Full token set: colors, spacing, radius, shadows, typography, motion, z-index
40
+ - **Reset** — Minimal, opinionated CSS reset
41
+ - **Component Styles** — Styles for every `/react` component
42
+ - **Dark Mode** — Automatic via `[data-theme="dark"]` attribute
43
+ - **Utilities** — Common helper classes
44
+
45
+ ## Documentation
46
+
47
+ Visit [tokis.dev](https://tokis.dev/docs/theming) for the theming guide.
48
+
49
+ ## License
50
+
51
+ MIT
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@tokis/theme",
3
+ "version": "1.0.0",
4
+ "description": "Default visual theme for Tokis — CSS variables, component styles, reset, and typography. Zero-runtime, precompiled CSS.",
5
+ "exports": {
6
+ ".": "./src/index.css",
7
+ "./base": "./src/base/index.css",
8
+ "./base/variables": "./src/base/variables.css",
9
+ "./base/reset": "./src/base/reset.css",
10
+ "./components": "./src/components/index.css",
11
+ "./components/button": "./src/components/button.css",
12
+ "./components/input": "./src/components/input.css",
13
+ "./components/checkbox": "./src/components/checkbox.css",
14
+ "./components/switch": "./src/components/switch.css",
15
+ "./components/select": "./src/components/select.css",
16
+ "./components/slider": "./src/components/slider.css",
17
+ "./components/dialog": "./src/components/dialog.css",
18
+ "./components/drawer": "./src/components/drawer.css",
19
+ "./components/tabs": "./src/components/tabs.css",
20
+ "./components/accordion": "./src/components/accordion.css",
21
+ "./components/tooltip": "./src/components/tooltip.css",
22
+ "./components/avatar": "./src/components/avatar.css",
23
+ "./components/alert": "./src/components/alert.css",
24
+ "./components/progress": "./src/components/progress.css",
25
+ "./components/card": "./src/components/card.css",
26
+ "./components/navigation": "./src/components/navigation.css",
27
+ "./utilities": "./src/utilities/index.css"
28
+ },
29
+ "main": "./src/index.css",
30
+ "files": [
31
+ "src",
32
+ "README.md",
33
+ "LICENSE"
34
+ ],
35
+ "sideEffects": [
36
+ "**/*.css"
37
+ ],
38
+ "keywords": [
39
+ "tokis",
40
+ "design-system",
41
+ "css",
42
+ "theme",
43
+ "css-variables",
44
+ "custom-properties",
45
+ "dark-mode",
46
+ "light-mode",
47
+ "theming",
48
+ "design-tokens",
49
+ "reset",
50
+ "typography",
51
+ "component-styles",
52
+ "zero-runtime"
53
+ ],
54
+ "author": "Tokis Contributors",
55
+ "license": "MIT",
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "https://github.com/tokis-design/tokis.git",
59
+ "directory": "packages/theme"
60
+ },
61
+ "homepage": "https://tokis.dev/docs/theming",
62
+ "bugs": {
63
+ "url": "https://github.com/tokis-design/tokis/issues"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public",
67
+ "registry": "https://registry.npmjs.org/"
68
+ }
69
+ }
@@ -0,0 +1,19 @@
1
+ /* ============================================================
2
+ Tokis — Typography base styles
3
+ ============================================================ */
4
+
5
+ .tokis-h1, h1 { font-size: var(--tokis-font-size-4xl); font-weight: var(--tokis-font-weight-bold); line-height: var(--tokis-line-height-tight); letter-spacing: var(--tokis-letter-spacing-tight); }
6
+ .tokis-h2, h2 { font-size: var(--tokis-font-size-3xl); font-weight: var(--tokis-font-weight-bold); line-height: var(--tokis-line-height-tight); letter-spacing: var(--tokis-letter-spacing-tight); }
7
+ .tokis-h3, h3 { font-size: var(--tokis-font-size-2xl); font-weight: var(--tokis-font-weight-semibold); line-height: var(--tokis-line-height-tight); }
8
+ .tokis-h4, h4 { font-size: var(--tokis-font-size-xl); font-weight: var(--tokis-font-weight-semibold); line-height: var(--tokis-line-height-tight); }
9
+ .tokis-h5, h5 { font-size: var(--tokis-font-size-lg); font-weight: var(--tokis-font-weight-medium); }
10
+ .tokis-h6, h6 { font-size: var(--tokis-font-size-md); font-weight: var(--tokis-font-weight-medium); }
11
+
12
+ code, kbd, samp, pre {
13
+ font-family: var(--tokis-font-family-mono);
14
+ font-size: 0.9em;
15
+ }
16
+
17
+ @import "./reset.css";
18
+ @import "./variables.css";
19
+
@@ -0,0 +1,76 @@
1
+ /* ============================================================
2
+ Tokis — CSS Reset & Base
3
+ Inspired by modern-normalize, scoped for design system use
4
+ ============================================================ */
5
+
6
+ *, *::before, *::after {
7
+ box-sizing: border-box;
8
+ margin: 0;
9
+ padding: 0;
10
+ }
11
+
12
+ html {
13
+ -webkit-text-size-adjust: 100%;
14
+ tab-size: 4;
15
+ scroll-behavior: smooth;
16
+ }
17
+
18
+ body {
19
+ font-family: var(--tokis-font-family);
20
+ font-size: var(--tokis-font-size-md);
21
+ line-height: 1.5;
22
+ color: var(--tokis-text-primary);
23
+ background-color: var(--tokis-color-background);
24
+ -webkit-font-smoothing: antialiased;
25
+ -moz-osx-font-smoothing: grayscale;
26
+ }
27
+
28
+ img, svg, video, canvas, audio, iframe, embed, object {
29
+ display: block;
30
+ max-width: 100%;
31
+ }
32
+
33
+ input, button, textarea, select {
34
+ font: inherit;
35
+ }
36
+
37
+ p, h1, h2, h3, h4, h5, h6 {
38
+ overflow-wrap: break-word;
39
+ }
40
+
41
+ a {
42
+ color: inherit;
43
+ text-decoration: none;
44
+ }
45
+
46
+ ul, ol {
47
+ list-style: none;
48
+ }
49
+
50
+ button {
51
+ cursor: pointer;
52
+ background: none;
53
+ border: none;
54
+ }
55
+
56
+ /* Focus visible — only show ring on keyboard navigation */
57
+ :focus-visible {
58
+ outline: 2px solid var(--tokis-color-primary);
59
+ outline-offset: 2px;
60
+ border-radius: var(--tokis-radius-sm);
61
+ }
62
+
63
+ :focus:not(:focus-visible) {
64
+ outline: none;
65
+ }
66
+
67
+ /* Reduced motion */
68
+ @media (prefers-reduced-motion: reduce) {
69
+ *, *::before, *::after {
70
+ animation-duration: 0.01ms !important;
71
+ animation-iteration-count: 1 !important;
72
+ transition-duration: 0.01ms !important;
73
+ scroll-behavior: auto !important;
74
+ }
75
+ }
76
+
@@ -0,0 +1,206 @@
1
+ /* ============================================================
2
+ Tokis — Design Token CSS Variables
3
+ Light theme default + dark theme via [data-theme="dark"]
4
+ ============================================================ */
5
+
6
+ :root {
7
+ /* Primitive Colors */
8
+ --tokis-color-primary: #0066ff;
9
+ --tokis-color-primary-hover: #0052cc;
10
+ --tokis-color-primary-active: #003d99;
11
+ --tokis-color-primary-subtle: #e6f0ff;
12
+ --tokis-color-secondary: #7c3aed;
13
+ --tokis-color-secondary-hover: #6d28d9;
14
+ --tokis-color-secondary-subtle: #ede9fe;
15
+ --tokis-color-background: #ffffff;
16
+ --tokis-color-surface: #f8f9fa;
17
+ --tokis-color-surface-raised: #ffffff;
18
+ --tokis-color-surface-overlay: #ffffff;
19
+ --tokis-color-border: #e2e8f0;
20
+ --tokis-color-border-strong: #cbd5e1;
21
+ --tokis-color-error: #dc2626;
22
+ --tokis-color-error-subtle: #fef2f2;
23
+ --tokis-color-warning: #d97706;
24
+ --tokis-color-warning-subtle: #fffbeb;
25
+ --tokis-color-success: #16a34a;
26
+ --tokis-color-success-subtle: #f0fdf4;
27
+ --tokis-color-info: #0284c7;
28
+ --tokis-color-info-subtle: #f0f9ff;
29
+
30
+ /* Neutral scale */
31
+ --tokis-color-neutral-50: #f8fafc;
32
+ --tokis-color-neutral-100: #f1f5f9;
33
+ --tokis-color-neutral-200: #e2e8f0;
34
+ --tokis-color-neutral-300: #cbd5e1;
35
+ --tokis-color-neutral-400: #94a3b8;
36
+ --tokis-color-neutral-500: #64748b;
37
+ --tokis-color-neutral-600: #475569;
38
+ --tokis-color-neutral-700: #334155;
39
+ --tokis-color-neutral-800: #1e293b;
40
+ --tokis-color-neutral-900: #0f172a;
41
+
42
+ /* Text */
43
+ --tokis-text-primary: #0f172a;
44
+ --tokis-text-secondary: #475569;
45
+ --tokis-text-tertiary: #94a3b8;
46
+ --tokis-text-disabled: #cbd5e1;
47
+ --tokis-text-inverse: #ffffff;
48
+ --tokis-text-on-primary: #ffffff;
49
+ --tokis-text-link: #0066ff;
50
+ --tokis-text-error: #dc2626;
51
+ --tokis-text-success: #16a34a;
52
+ --tokis-text-warning: #d97706;
53
+
54
+ /* Spacing */
55
+ --tokis-spacing-0: 0px;
56
+ --tokis-spacing-1: 4px;
57
+ --tokis-spacing-2: 8px;
58
+ --tokis-spacing-3: 12px;
59
+ --tokis-spacing-4: 16px;
60
+ --tokis-spacing-5: 20px;
61
+ --tokis-spacing-6: 24px;
62
+ --tokis-spacing-8: 32px;
63
+ --tokis-spacing-10: 40px;
64
+ --tokis-spacing-12: 48px;
65
+ --tokis-spacing-16: 64px;
66
+ --tokis-spacing-20: 80px;
67
+ --tokis-spacing-24: 96px;
68
+
69
+ /* Typography */
70
+ --tokis-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Helvetica, Arial, sans-serif;
71
+ --tokis-font-family-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
72
+ --tokis-font-size-xs: 0.75rem;
73
+ --tokis-font-size-sm: 0.875rem;
74
+ --tokis-font-size-md: 1rem;
75
+ --tokis-font-size-lg: 1.125rem;
76
+ --tokis-font-size-xl: 1.25rem;
77
+ --tokis-font-size-2xl: 1.5rem;
78
+ --tokis-font-size-3xl: 1.875rem;
79
+ --tokis-font-size-4xl: 2.25rem;
80
+ --tokis-font-weight-regular: 400;
81
+ --tokis-font-weight-medium: 500;
82
+ --tokis-font-weight-semibold: 600;
83
+ --tokis-font-weight-bold: 700;
84
+ --tokis-line-height-tight: 1.25;
85
+ --tokis-line-height-normal: 1.5;
86
+ --tokis-line-height-relaxed: 1.75;
87
+ --tokis-letter-spacing-tight: -0.025em;
88
+ --tokis-letter-spacing-normal: 0em;
89
+ --tokis-letter-spacing-wide: 0.025em;
90
+
91
+ /* Border Radius */
92
+ --tokis-radius-none: 0px;
93
+ --tokis-radius-xs: 2px;
94
+ --tokis-radius-sm: 4px;
95
+ --tokis-radius-md: 6px;
96
+ --tokis-radius-lg: 8px;
97
+ --tokis-radius-xl: 12px;
98
+ --tokis-radius-2xl: 16px;
99
+ --tokis-radius-full: 9999px;
100
+
101
+ /* Shadows */
102
+ --tokis-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
103
+ --tokis-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.10), 0 1px 2px -1px rgb(0 0 0 / 0.10);
104
+ --tokis-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
105
+ --tokis-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.10), 0 4px 6px -4px rgb(0 0 0 / 0.10);
106
+ --tokis-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10);
107
+ --tokis-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
108
+ --tokis-shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
109
+
110
+ /* Focus */
111
+ --tokis-color-focus-ring: rgb(0 102 255 / 0.15);
112
+ --tokis-color-focus-ring-error: rgb(220 38 38 / 0.15);
113
+
114
+ /* Surface interaction states */
115
+ --tokis-color-surface-hover: var(--tokis-color-neutral-100);
116
+ --tokis-color-surface-active: var(--tokis-color-neutral-200);
117
+
118
+ /* Motion */
119
+ --tokis-duration-fast: 100ms;
120
+ --tokis-duration-normal: 200ms;
121
+ --tokis-duration-slow: 300ms;
122
+ --tokis-duration-slower: 500ms;
123
+ --tokis-ease-in: cubic-bezier(0.4, 0, 1, 1);
124
+ --tokis-ease-out: cubic-bezier(0, 0, 0.2, 1);
125
+ --tokis-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
126
+ --tokis-ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
127
+
128
+ /* Z-index */
129
+ --tokis-z-base: 0;
130
+ --tokis-z-raised: 1;
131
+ --tokis-z-dropdown: 1000;
132
+ --tokis-z-sticky: 1100;
133
+ --tokis-z-overlay: 1200;
134
+ --tokis-z-modal: 1300;
135
+ --tokis-z-popover: 1400;
136
+ --tokis-z-tooltip: 1500;
137
+ --tokis-z-toast: 1600;
138
+
139
+ /* Breakpoints (for reference in JS, not used in CSS directly) */
140
+ --tokis-breakpoint-sm: 640px;
141
+ --tokis-breakpoint-md: 768px;
142
+ --tokis-breakpoint-lg: 1024px;
143
+ --tokis-breakpoint-xl: 1280px;
144
+ --tokis-breakpoint-2xl: 1536px;
145
+ }
146
+
147
+ /* ── Dark Theme ──────────────────────────────────────────── */
148
+ [data-theme="dark"] {
149
+ --tokis-color-primary: #3b82f6;
150
+ --tokis-color-primary-hover: #60a5fa;
151
+ --tokis-color-primary-active: #93c5fd;
152
+ --tokis-color-primary-subtle: #1e3a5f;
153
+ --tokis-color-secondary: #a78bfa;
154
+ --tokis-color-secondary-hover: #c4b5fd;
155
+ --tokis-color-secondary-subtle: #2e1065;
156
+ --tokis-color-background: #0f172a;
157
+ --tokis-color-surface: #1e293b;
158
+ --tokis-color-surface-raised: #293548;
159
+ --tokis-color-surface-overlay: #1e293b;
160
+ --tokis-color-border: #334155;
161
+ --tokis-color-border-strong: #475569;
162
+ --tokis-color-error: #f87171;
163
+ --tokis-color-error-subtle: #450a0a;
164
+ --tokis-color-warning: #fbbf24;
165
+ --tokis-color-warning-subtle: #451a03;
166
+ --tokis-color-success: #4ade80;
167
+ --tokis-color-success-subtle: #052e16;
168
+ --tokis-color-info: #38bdf8;
169
+ --tokis-color-info-subtle: #082f49;
170
+
171
+ --tokis-color-neutral-50: #0f172a;
172
+ --tokis-color-neutral-100: #1e293b;
173
+ --tokis-color-neutral-200: #334155;
174
+ --tokis-color-neutral-300: #475569;
175
+ --tokis-color-neutral-400: #64748b;
176
+ --tokis-color-neutral-500: #94a3b8;
177
+ --tokis-color-neutral-600: #cbd5e1;
178
+ --tokis-color-neutral-700: #e2e8f0;
179
+ --tokis-color-neutral-800: #f1f5f9;
180
+ --tokis-color-neutral-900: #f8fafc;
181
+
182
+ --tokis-text-primary: #f1f5f9;
183
+ --tokis-text-secondary: #94a3b8;
184
+ --tokis-text-tertiary: #64748b;
185
+ --tokis-text-disabled: #475569;
186
+ --tokis-text-inverse: #0f172a;
187
+ --tokis-text-on-primary: #ffffff;
188
+ --tokis-text-link: #60a5fa;
189
+ --tokis-text-error: #f87171;
190
+ --tokis-text-success: #4ade80;
191
+ --tokis-text-warning: #fbbf24;
192
+
193
+ --tokis-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
194
+ --tokis-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
195
+ --tokis-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
196
+ --tokis-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
197
+ --tokis-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
198
+
199
+ --tokis-color-focus-ring: rgb(59 130 246 / 0.2);
200
+ --tokis-color-focus-ring-error: rgb(248 113 113 / 0.2);
201
+
202
+ /* Dark mode surface-hover needs to be noticeably different from surface-overlay */
203
+ --tokis-color-surface-hover: var(--tokis-color-neutral-200); /* #334155 vs overlay #1e293b */
204
+ --tokis-color-surface-active: var(--tokis-color-neutral-300); /* #475569 */
205
+ }
206
+
@@ -0,0 +1,124 @@
1
+ /* ============================================================
2
+ Tokis — Accordion
3
+ ============================================================ */
4
+
5
+ .tokis-accordion-root {
6
+ width: 100%;
7
+ border: 1px solid var(--tokis-color-border);
8
+ border-radius: var(--tokis-radius-lg);
9
+ overflow: hidden;
10
+ }
11
+ .tokis-accordion-root--flush {
12
+ border: none;
13
+ border-radius: 0;
14
+ }
15
+
16
+ /* ── Item ───────────────────────────────────────────────────── */
17
+
18
+ .tokis-accordion-item {
19
+ border-bottom: 1px solid var(--tokis-color-border);
20
+ }
21
+ .tokis-accordion-item:last-child {
22
+ border-bottom: none;
23
+ }
24
+
25
+ /* ── Trigger ────────────────────────────────────────────────── */
26
+
27
+ .tokis-accordion-trigger {
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: space-between;
31
+ width: 100%;
32
+ padding: var(--tokis-spacing-4) var(--tokis-spacing-5);
33
+ font-size: var(--tokis-font-size-sm);
34
+ font-weight: var(--tokis-font-weight-medium);
35
+ font-family: inherit;
36
+ color: var(--tokis-text-primary);
37
+ background: none;
38
+ border: none;
39
+ text-align: left;
40
+ cursor: pointer;
41
+ transition: background var(--tokis-duration-fast) var(--tokis-ease-out);
42
+ outline: none;
43
+ gap: var(--tokis-spacing-3);
44
+ -webkit-tap-highlight-color: transparent;
45
+ }
46
+
47
+ .tokis-accordion-trigger:hover {
48
+ background: var(--tokis-color-surface-hover);
49
+ }
50
+
51
+ .tokis-accordion-trigger:focus-visible {
52
+ outline: 2px solid var(--tokis-color-primary);
53
+ outline-offset: -2px;
54
+ }
55
+
56
+ .tokis-accordion-trigger[aria-expanded="true"] {
57
+ color: var(--tokis-color-primary);
58
+ }
59
+
60
+ .tokis-accordion-trigger[aria-disabled="true"],
61
+ .tokis-accordion-trigger:disabled {
62
+ opacity: 0.45;
63
+ cursor: not-allowed;
64
+ pointer-events: none;
65
+ }
66
+
67
+ /* ── Trigger icon ───────────────────────────────────────────── */
68
+
69
+ .tokis-accordion-trigger__icon {
70
+ flex-shrink: 0;
71
+ color: var(--tokis-text-tertiary);
72
+ transition: transform var(--tokis-duration-normal) var(--tokis-ease-in-out);
73
+ will-change: transform;
74
+ }
75
+ .tokis-accordion-trigger[aria-expanded="true"] .tokis-accordion-trigger__icon {
76
+ transform: rotate(180deg);
77
+ color: var(--tokis-color-primary);
78
+ }
79
+
80
+ /* ── Content — CSS grid height animation ────────────────────── */
81
+ /* Uses grid-template-rows trick for smooth height animation */
82
+ /* without needing to know the height in JS */
83
+
84
+ .tokis-accordion-content {
85
+ display: grid;
86
+ grid-template-rows: 0fr;
87
+ transition:
88
+ grid-template-rows var(--tokis-duration-normal) var(--tokis-ease-in-out),
89
+ opacity var(--tokis-duration-normal) var(--tokis-ease-out);
90
+ opacity: 0;
91
+ overflow: hidden;
92
+ }
93
+
94
+ .tokis-accordion-content[data-open="true"] {
95
+ grid-template-rows: 1fr;
96
+ opacity: 1;
97
+ }
98
+
99
+ .tokis-accordion-content-inner {
100
+ overflow: hidden;
101
+ font-size: var(--tokis-font-size-sm);
102
+ color: var(--tokis-text-secondary);
103
+ line-height: var(--tokis-line-height-relaxed);
104
+ padding: 0 var(--tokis-spacing-5) var(--tokis-spacing-3);
105
+ }
106
+
107
+ /* ── Flush variant ──────────────────────────────────────────── */
108
+
109
+ .tokis-accordion-root--flush .tokis-accordion-trigger {
110
+ padding-left: 0;
111
+ padding-right: 0;
112
+ }
113
+ .tokis-accordion-root--flush .tokis-accordion-content-inner {
114
+ padding-left: 0;
115
+ padding-right: 0;
116
+ }
117
+
118
+ /* ── Reduced motion ─────────────────────────────────────────── */
119
+
120
+ @media (prefers-reduced-motion: reduce) {
121
+ .tokis-accordion-trigger { transition: none; }
122
+ .tokis-accordion-trigger__icon { transition: none; }
123
+ .tokis-accordion-content { transition: none; }
124
+ }