@kadoui/tailwindcss 1.0.0 → 1.2.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 +1347 -80
- package/package.json +1 -1
- package/src/styles/alert.css +0 -2
- package/src/styles/badge.css +0 -2
- package/src/styles/base.css +50 -39
- package/src/styles/button.css +0 -2
- package/src/styles/card.css +0 -2
- package/src/styles/components/modal.css +16 -4
- package/src/styles/components/select-box.css +1 -1
- package/src/styles/input.css +0 -2
- package/src/styles/kbd.css +0 -2
package/README.md
CHANGED
|
@@ -1,127 +1,1394 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kadoui/tailwindcss
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**A comprehensive Tailwind CSS utility system for building beautiful, accessible UIs**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@kadoui/tailwindcss)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Introduction
|
|
15
|
+
|
|
16
|
+
`@kadoui/tailwindcss` is a comprehensive Tailwind CSS utility system that provides a complete design system with components, utilities, and design tokens. It's designed to work seamlessly with `@kadoui/react` components but can be used independently with any framework.
|
|
17
|
+
|
|
18
|
+
### Key Features
|
|
19
|
+
|
|
20
|
+
- 🎨 **Complete Design System** - Pre-built components and utilities
|
|
21
|
+
- 🎯 **Consistent Spacing** - Unified spacing scale
|
|
22
|
+
- 🌓 **Dark Mode Support** - Built-in dark mode utilities
|
|
23
|
+
- 📱 **Responsive** - Mobile-first approach
|
|
24
|
+
- 🎭 **Customizable** - Easy to extend and customize
|
|
25
|
+
- ♿ **Accessible** - Built with accessibility in mind
|
|
26
|
+
- 🚀 **Tailwind CSS 4** - Uses latest Tailwind CSS features
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @kadoui/tailwindcss tailwindcss
|
|
34
|
+
# or
|
|
35
|
+
pnpm add @kadoui/tailwindcss tailwindcss
|
|
36
|
+
# or
|
|
37
|
+
yarn add @kadoui/tailwindcss tailwindcss
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Peer Dependencies
|
|
41
|
+
|
|
42
|
+
- `tailwindcss` ^4.0.0
|
|
43
|
+
- `@tailwindcss/postcss` ^4.0.0 (for PostCSS)
|
|
4
44
|
|
|
5
45
|
---
|
|
6
46
|
|
|
7
|
-
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
### 1. Import in your CSS
|
|
50
|
+
|
|
51
|
+
Create or update your main CSS file (e.g., `globals.css`):
|
|
8
52
|
|
|
9
53
|
```css
|
|
10
54
|
@import "tailwindcss";
|
|
11
|
-
@import "@kadoui/
|
|
55
|
+
@import "@kadoui/tailwindcss";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 2. Configure Theme Variables
|
|
59
|
+
|
|
60
|
+
Set up your color system and design tokens:
|
|
61
|
+
|
|
62
|
+
```css
|
|
63
|
+
:root {
|
|
64
|
+
/* Background colors */
|
|
65
|
+
--background: #efefef;
|
|
66
|
+
--background-thin: #ffffff;
|
|
67
|
+
--background-thick: #dfdfdf;
|
|
68
|
+
|
|
69
|
+
/* Foreground colors */
|
|
70
|
+
--foreground: #151515;
|
|
71
|
+
--foreground-thin: #303030;
|
|
72
|
+
--foreground-thick: #000000;
|
|
73
|
+
|
|
74
|
+
/* Semantic colors */
|
|
75
|
+
--primary: #ff5e00;
|
|
76
|
+
--primary-foreground: #ffffff;
|
|
77
|
+
--secondary: #ab00c2;
|
|
78
|
+
--secondary-foreground: #ffffff;
|
|
79
|
+
--error: #ff0000;
|
|
80
|
+
--error-foreground: #ffffff;
|
|
81
|
+
--success: #00b600;
|
|
82
|
+
--success-foreground: #ffffff;
|
|
83
|
+
--warning: #ffd900;
|
|
84
|
+
--warning-foreground: #ffffff;
|
|
85
|
+
--info: #0000dd;
|
|
86
|
+
--info-foreground: #ffffff;
|
|
87
|
+
|
|
88
|
+
/* Palette system */
|
|
89
|
+
--palette: var(--foreground);
|
|
90
|
+
--brush: var(--background);
|
|
91
|
+
|
|
92
|
+
/* Element sizing variables */
|
|
93
|
+
--element-xs-h: calc(var(--spacing) * 6);
|
|
94
|
+
--element-sm-h: calc(var(--spacing) * 8);
|
|
95
|
+
--element-medium-h: calc(var(--spacing) * 10);
|
|
96
|
+
--element-lg-h: calc(var(--spacing) * 12);
|
|
97
|
+
--element-xl-h: calc(var(--spacing) * 14);
|
|
98
|
+
|
|
99
|
+
--element-xs-spacing: calc(var(--spacing) * 1);
|
|
100
|
+
--element-sm-spacing: calc(var(--spacing) * 1.5);
|
|
101
|
+
--element-medium-spacing: calc(var(--spacing) * 3);
|
|
102
|
+
--element-lg-spacing: calc(var(--spacing) * 6);
|
|
103
|
+
--element-xl-spacing: calc(var(--spacing) * 9);
|
|
104
|
+
|
|
105
|
+
/* Default element size */
|
|
106
|
+
--element-h: var(--element-medium-h);
|
|
107
|
+
--element-spacing: var(--element-medium-spacing);
|
|
108
|
+
--element-text: var(--text-base);
|
|
109
|
+
--element-leading: var(--text-base--line-height);
|
|
110
|
+
--element-rounded: var(--radius-lg);
|
|
111
|
+
}
|
|
12
112
|
|
|
13
113
|
@theme {
|
|
14
|
-
--
|
|
15
|
-
--
|
|
16
|
-
|
|
17
|
-
--color
|
|
18
|
-
--color-
|
|
19
|
-
--color-
|
|
20
|
-
--color-
|
|
21
|
-
--color-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
--color-
|
|
25
|
-
--color-
|
|
114
|
+
--color-background: var(--background);
|
|
115
|
+
--color-background-thin: var(--background-thin);
|
|
116
|
+
--color-background-thick: var(--background-thick);
|
|
117
|
+
--color-foreground: var(--foreground);
|
|
118
|
+
--color-foreground-thin: var(--foreground-thin);
|
|
119
|
+
--color-foreground-thick: var(--foreground-thick);
|
|
120
|
+
--color-primary: var(--primary);
|
|
121
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
122
|
+
--color-secondary: var(--secondary);
|
|
123
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
124
|
+
--color-error: var(--error);
|
|
125
|
+
--color-error-foreground: var(--error-foreground);
|
|
126
|
+
--color-success: var(--success);
|
|
127
|
+
--color-success-foreground: var(--success-foreground);
|
|
128
|
+
--color-warning: var(--warning);
|
|
129
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
130
|
+
--color-info: var(--info);
|
|
131
|
+
--color-info-foreground: var(--info-foreground);
|
|
132
|
+
|
|
133
|
+
--color-palette: var(--palette);
|
|
134
|
+
--color-brush: var(--brush);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Dark mode */
|
|
138
|
+
[data-theme="dark"] {
|
|
139
|
+
--background: #151515;
|
|
140
|
+
--background-thin: #303030;
|
|
141
|
+
--background-thick: #000000;
|
|
142
|
+
--foreground: #efefef;
|
|
143
|
+
--foreground-thin: #ffffff;
|
|
144
|
+
--foreground-thick: #dfdfdf;
|
|
26
145
|
}
|
|
27
146
|
|
|
147
|
+
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 3. PostCSS Configuration (Optional)
|
|
151
|
+
|
|
152
|
+
If you need PostCSS configuration:
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
// postcss.config.js
|
|
156
|
+
import { kadouiPostcssConfig } from "@kadoui/tailwindcss/postcss";
|
|
157
|
+
|
|
158
|
+
export default kadouiPostcssConfig;
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Or manually:
|
|
162
|
+
|
|
163
|
+
```js
|
|
164
|
+
// postcss.config.js
|
|
165
|
+
export default {
|
|
166
|
+
plugins: {
|
|
167
|
+
"@tailwindcss/postcss": {},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Design System
|
|
175
|
+
|
|
176
|
+
### Spacing Scale
|
|
177
|
+
|
|
178
|
+
The design system uses a consistent spacing scale based on Tailwind's default spacing:
|
|
179
|
+
|
|
180
|
+
| Level | Value | Usage |
|
|
181
|
+
| ----- | ----------- | -------------------- |
|
|
182
|
+
| lvl-1 | `0.5` (2px) | Tight spacing, icons |
|
|
183
|
+
| lvl-2 | `1.5` (6px) | Small gaps |
|
|
184
|
+
| lvl-3 | `3` (12px) | Default spacing |
|
|
185
|
+
| lvl-4 | `6` (24px) | Large gaps |
|
|
186
|
+
| lvl-5 | `9` (36px) | Extra large gaps |
|
|
187
|
+
| lvl-6 | `12` (48px) | Section spacing |
|
|
188
|
+
| lvl-7 | `16` (64px) | Page sections |
|
|
189
|
+
| lvl-8 | `20` (80px) | Major sections |
|
|
190
|
+
|
|
191
|
+
### Breakpoints
|
|
192
|
+
|
|
193
|
+
| Breakpoint | Min Width | Description |
|
|
194
|
+
| ---------- | --------- | ------------------- |
|
|
195
|
+
| `sm` | 640px | Mobile |
|
|
196
|
+
| `md` | 768px | Tablet |
|
|
197
|
+
| `lg` | 1024px | Desktop |
|
|
198
|
+
| `xl` | 1280px | Large desktop |
|
|
199
|
+
| `2xl` | 1536px | Extra large desktop |
|
|
200
|
+
|
|
201
|
+
**Recommended Usage:**
|
|
202
|
+
|
|
203
|
+
- `sm` - Mobile-first (default)
|
|
204
|
+
- `sm:` - Tablet and up
|
|
205
|
+
- `lg:` - Desktop and up
|
|
206
|
+
|
|
207
|
+
### Color System
|
|
208
|
+
|
|
209
|
+
#### Base Colors
|
|
210
|
+
|
|
211
|
+
- `background` - Main background color
|
|
212
|
+
- `background-thin` - Lighter background variant
|
|
213
|
+
- `background-thick` - Darker background variant
|
|
214
|
+
- `foreground` - Main text color
|
|
215
|
+
- `foreground-thin` - Lighter text variant
|
|
216
|
+
- `foreground-thick` - Darker text variant
|
|
217
|
+
|
|
218
|
+
#### Semantic Colors
|
|
219
|
+
|
|
220
|
+
- `primary` - Primary brand color
|
|
221
|
+
- `secondary` - Secondary brand color
|
|
222
|
+
- `error` - Error states
|
|
223
|
+
- `success` - Success states
|
|
224
|
+
- `warning` - Warning states
|
|
225
|
+
- `info` - Informational states
|
|
226
|
+
|
|
227
|
+
Each semantic color has a corresponding `-foreground` variant for text/icons.
|
|
228
|
+
|
|
229
|
+
#### Palette System
|
|
230
|
+
|
|
231
|
+
The palette system allows you to dynamically change colors using CSS variables:
|
|
232
|
+
|
|
233
|
+
- `--color-palette` - Main color (used for backgrounds, borders, etc.)
|
|
234
|
+
- `--color-brush` - Contrasting color (used for text, icons, etc.)
|
|
235
|
+
|
|
236
|
+
**Palette Utilities:**
|
|
237
|
+
|
|
238
|
+
```css
|
|
239
|
+
/* Set palette to background colors */
|
|
240
|
+
palette-background
|
|
241
|
+
palette-background-thin
|
|
242
|
+
palette-background-thick
|
|
243
|
+
|
|
244
|
+
/* Set palette to foreground colors */
|
|
245
|
+
palette-foreground
|
|
246
|
+
palette-foreground-thin
|
|
247
|
+
palette-foreground-thick
|
|
248
|
+
|
|
249
|
+
/* Set palette to semantic colors */
|
|
250
|
+
palette-primary
|
|
251
|
+
palette-secondary
|
|
252
|
+
palette-error
|
|
253
|
+
palette-success
|
|
254
|
+
palette-warning
|
|
255
|
+
palette-info
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Example:**
|
|
259
|
+
|
|
260
|
+
```html
|
|
261
|
+
<!-- Button uses foreground palette -->
|
|
262
|
+
<button class="btn btn-fill palette-foreground">Click me</button>
|
|
263
|
+
|
|
264
|
+
<!-- Button uses primary palette -->
|
|
265
|
+
<button class="btn btn-fill palette-primary">Primary</button>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Element Sizing System
|
|
269
|
+
|
|
270
|
+
The element sizing system provides consistent sizing across components:
|
|
271
|
+
|
|
272
|
+
#### Size Variants
|
|
273
|
+
|
|
274
|
+
- `element-xs` - Extra small (6 × spacing)
|
|
275
|
+
- `element-sm` - Small (8 × spacing)
|
|
276
|
+
- `element-md` - Medium (10 × spacing) - **Default**
|
|
277
|
+
- `element-lg` - Large (12 × spacing)
|
|
278
|
+
- `element-xl` - Extra large (14 × spacing)
|
|
279
|
+
|
|
280
|
+
Each size variant sets:
|
|
281
|
+
|
|
282
|
+
- `--element-h` - Height
|
|
283
|
+
- `--element-spacing` - Padding/spacing
|
|
284
|
+
- `--element-text` - Font size
|
|
285
|
+
- `--element-leading` - Line height
|
|
286
|
+
- `--element-rounded` - Border radius
|
|
287
|
+
|
|
288
|
+
**Example:**
|
|
289
|
+
|
|
290
|
+
```html
|
|
291
|
+
<!-- Small button -->
|
|
292
|
+
<button class="btn btn-fill element-sm">Small</button>
|
|
293
|
+
|
|
294
|
+
<!-- Default button -->
|
|
295
|
+
<button class="btn btn-fill">Default</button>
|
|
296
|
+
|
|
297
|
+
<!-- Large button -->
|
|
298
|
+
<button class="btn btn-fill element-lg">Large</button>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
#### Element Utilities
|
|
302
|
+
|
|
303
|
+
- `element-square-size` - Makes element square (width = height)
|
|
304
|
+
- `element-w-full` - Full width element
|
|
305
|
+
- `element-icon-size` - Icon size (half of element height)
|
|
306
|
+
|
|
307
|
+
**Example:**
|
|
308
|
+
|
|
309
|
+
```html
|
|
310
|
+
<!-- Square button -->
|
|
311
|
+
<button class="btn btn-fill element-square-size">
|
|
312
|
+
<Icon />
|
|
313
|
+
</button>
|
|
314
|
+
|
|
315
|
+
<!-- Full width button -->
|
|
316
|
+
<button class="btn btn-fill element-w-full">Full Width</button>
|
|
317
|
+
|
|
318
|
+
<!-- Icon -->
|
|
319
|
+
<Icon class="element-icon-size" />
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Border Radius
|
|
323
|
+
|
|
324
|
+
| Level | Class | Value |
|
|
325
|
+
| ----- | ------------- | ------------------ |
|
|
326
|
+
| lvl-1 | `rounded` | Small radius |
|
|
327
|
+
| lvl-2 | `rounded-md` | Medium radius |
|
|
328
|
+
| lvl-3 | `rounded-lg` | Large radius |
|
|
329
|
+
| lvl-4 | `rounded-xl` | Extra large radius |
|
|
330
|
+
| lvl-5 | `rounded-2xl` | 2XL radius |
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Base Utilities
|
|
335
|
+
|
|
336
|
+
### Typography
|
|
337
|
+
|
|
338
|
+
#### Headings
|
|
339
|
+
|
|
340
|
+
```html
|
|
341
|
+
<h1 class="heading">Main Heading</h1>
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Recommended Pattern:**
|
|
345
|
+
|
|
346
|
+
```html
|
|
347
|
+
<h1 class="text-xl sm:text-2xl lg:text-5xl font-black">Responsive Heading</h1>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
#### Titles
|
|
351
|
+
|
|
352
|
+
```html
|
|
353
|
+
<h2 class="title">Section Title</h2>
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Recommended Pattern:**
|
|
357
|
+
|
|
358
|
+
```html
|
|
359
|
+
<h2 class="text-base sm:text-lg lg:text-xl font-bold">Responsive Title</h2>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
#### Paragraphs
|
|
363
|
+
|
|
364
|
+
**Recommended Pattern:**
|
|
365
|
+
|
|
366
|
+
```html
|
|
367
|
+
<p class="text-sm sm:text-base">Responsive paragraph text</p>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Layout Utilities
|
|
371
|
+
|
|
372
|
+
#### Wrapper
|
|
373
|
+
|
|
374
|
+
Centered container with max-width:
|
|
375
|
+
|
|
376
|
+
```html
|
|
377
|
+
<div class="wrapper">
|
|
378
|
+
<!-- Content -->
|
|
379
|
+
</div>
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Default:** `max-w-5xl` with horizontal padding
|
|
383
|
+
|
|
384
|
+
### General Utilities
|
|
385
|
+
|
|
386
|
+
#### Link
|
|
387
|
+
|
|
388
|
+
Styled link with hover underline:
|
|
389
|
+
|
|
390
|
+
```html
|
|
391
|
+
<a
|
|
392
|
+
href="#"
|
|
393
|
+
class="link"
|
|
394
|
+
>Link text</a
|
|
395
|
+
>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
#### Highlight
|
|
399
|
+
|
|
400
|
+
Highlight text with background:
|
|
401
|
+
|
|
402
|
+
```html
|
|
403
|
+
<span class="highlight">Highlighted text</span>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
#### Ignore / Not-Ignore
|
|
407
|
+
|
|
408
|
+
Hide/show elements:
|
|
409
|
+
|
|
410
|
+
```html
|
|
411
|
+
<div class="ignore">Hidden</div>
|
|
412
|
+
<div class="not-ignore">Visible</div>
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
#### No Scrollbar
|
|
416
|
+
|
|
417
|
+
Hide scrollbar:
|
|
418
|
+
|
|
419
|
+
```html
|
|
420
|
+
<div class="no-scrollbar overflow-auto">Scrollable content</div>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
#### Width Fix
|
|
424
|
+
|
|
425
|
+
```html
|
|
426
|
+
<div class="w-fix">Content with max-width</div>
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## Component Styles
|
|
432
|
+
|
|
433
|
+
### Button
|
|
434
|
+
|
|
435
|
+
Buttons are the foundation of interactive elements.
|
|
436
|
+
|
|
437
|
+
#### Base Button
|
|
438
|
+
|
|
439
|
+
```html
|
|
440
|
+
<button class="btn">Button</button>
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
#### Button Variants
|
|
444
|
+
|
|
445
|
+
- `btn-fill` - Filled button (background + text)
|
|
446
|
+
- `btn-outline` - Outlined button (border + text)
|
|
447
|
+
- `btn-soft` - Soft button (subtle background)
|
|
448
|
+
- `btn-ghost` - Ghost button (text only, hover background)
|
|
449
|
+
|
|
450
|
+
**Examples:**
|
|
451
|
+
|
|
452
|
+
```html
|
|
453
|
+
<!-- Filled button -->
|
|
454
|
+
<button class="btn btn-fill">Primary</button>
|
|
455
|
+
|
|
456
|
+
<!-- Outlined button -->
|
|
457
|
+
<button class="btn btn-outline">Secondary</button>
|
|
458
|
+
|
|
459
|
+
<!-- Soft button -->
|
|
460
|
+
<button class="btn btn-soft">Tertiary</button>
|
|
461
|
+
|
|
462
|
+
<!-- Ghost button -->
|
|
463
|
+
<button class="btn btn-ghost">Minimal</button>
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
#### Button States
|
|
467
|
+
|
|
468
|
+
Buttons automatically handle:
|
|
469
|
+
|
|
470
|
+
- `disabled` - Reduced opacity, no pointer events
|
|
471
|
+
- `focus-visible` - Outline ring
|
|
472
|
+
- `active` - Reduced opacity
|
|
473
|
+
- `hover` - Background changes
|
|
474
|
+
|
|
475
|
+
**Example:**
|
|
476
|
+
|
|
477
|
+
```html
|
|
478
|
+
<button
|
|
479
|
+
class="btn btn-fill"
|
|
480
|
+
disabled>
|
|
481
|
+
Disabled
|
|
482
|
+
</button>
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### Button Sizes
|
|
486
|
+
|
|
487
|
+
```html
|
|
488
|
+
<button class="btn btn-fill element-xs">Extra Small</button>
|
|
489
|
+
<button class="btn btn-fill element-sm">Small</button>
|
|
490
|
+
<button class="btn btn-fill">Default</button>
|
|
491
|
+
<button class="btn btn-fill element-lg">Large</button>
|
|
492
|
+
<button class="btn btn-fill element-xl">Extra Large</button>
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
#### Square Buttons
|
|
496
|
+
|
|
497
|
+
```html
|
|
498
|
+
<button class="btn btn-fill element-square-size">
|
|
499
|
+
<Icon />
|
|
500
|
+
</button>
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
#### Full Width Buttons
|
|
504
|
+
|
|
505
|
+
```html
|
|
506
|
+
<button class="btn btn-fill element-w-full">Full Width</button>
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
#### Button with Data States
|
|
510
|
+
|
|
511
|
+
```html
|
|
512
|
+
<!-- Active state -->
|
|
513
|
+
<button class="btn data-[state=true]:btn-fill data-[state=false]:btn-soft">Toggle</button>
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
---
|
|
517
|
+
|
|
518
|
+
### Input
|
|
519
|
+
|
|
520
|
+
Inputs are built using `<label>` elements for better accessibility.
|
|
521
|
+
|
|
522
|
+
#### Base Input
|
|
523
|
+
|
|
524
|
+
```html
|
|
525
|
+
<label class="input">
|
|
526
|
+
<input
|
|
527
|
+
type="text"
|
|
528
|
+
class="input-field"
|
|
529
|
+
placeholder="Enter text" />
|
|
530
|
+
</label>
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
#### Input Variants
|
|
534
|
+
|
|
535
|
+
- `input-outline` - Outlined input (border)
|
|
536
|
+
- `input-soft` - Soft input (background)
|
|
537
|
+
|
|
538
|
+
**Examples:**
|
|
539
|
+
|
|
540
|
+
```html
|
|
541
|
+
<!-- Outlined input -->
|
|
542
|
+
<label class="input input-outline">
|
|
543
|
+
<input
|
|
544
|
+
type="text"
|
|
545
|
+
class="input-field"
|
|
546
|
+
placeholder="Outlined" />
|
|
547
|
+
</label>
|
|
548
|
+
|
|
549
|
+
<!-- Soft input -->
|
|
550
|
+
<label class="input input-soft">
|
|
551
|
+
<input
|
|
552
|
+
type="text"
|
|
553
|
+
class="input-field"
|
|
554
|
+
placeholder="Soft" />
|
|
555
|
+
</label>
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
#### Input with Icons
|
|
559
|
+
|
|
560
|
+
```html
|
|
561
|
+
<label class="input input-outline">
|
|
562
|
+
<SearchIcon class="element-icon-size" />
|
|
563
|
+
<input
|
|
564
|
+
type="text"
|
|
565
|
+
class="input-field"
|
|
566
|
+
placeholder="Search" />
|
|
567
|
+
</label>
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
#### Input Sizes
|
|
571
|
+
|
|
572
|
+
```html
|
|
573
|
+
<label class="input input-outline element-xs">
|
|
574
|
+
<input
|
|
575
|
+
type="text"
|
|
576
|
+
class="input-field"
|
|
577
|
+
placeholder="XS" />
|
|
578
|
+
</label>
|
|
579
|
+
|
|
580
|
+
<label class="input input-outline element-sm">
|
|
581
|
+
<input
|
|
582
|
+
type="text"
|
|
583
|
+
class="input-field"
|
|
584
|
+
placeholder="SM" />
|
|
585
|
+
</label>
|
|
586
|
+
|
|
587
|
+
<label class="input input-outline">
|
|
588
|
+
<input
|
|
589
|
+
type="text"
|
|
590
|
+
class="input-field"
|
|
591
|
+
placeholder="Default" />
|
|
592
|
+
</label>
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
#### Textarea
|
|
596
|
+
|
|
597
|
+
```html
|
|
598
|
+
<label class="input input-outline">
|
|
599
|
+
<textarea
|
|
600
|
+
class="input-field"
|
|
601
|
+
placeholder="Message"></textarea>
|
|
602
|
+
</label>
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
#### File Input
|
|
606
|
+
|
|
607
|
+
```html
|
|
608
|
+
<label class="input input-outline">
|
|
609
|
+
<input
|
|
610
|
+
type="file"
|
|
611
|
+
class="input-field" />
|
|
612
|
+
</label>
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
---
|
|
616
|
+
|
|
617
|
+
### Card
|
|
618
|
+
|
|
619
|
+
Card component for content containers.
|
|
620
|
+
|
|
621
|
+
#### Base Card
|
|
622
|
+
|
|
623
|
+
```html
|
|
624
|
+
<div class="card">Card content</div>
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
#### Card Variants
|
|
628
|
+
|
|
629
|
+
- `card-menu` - Menu-style card (width: max-content)
|
|
630
|
+
- `card-y` - Vertical card (flex column with gap)
|
|
631
|
+
- `card-x` - Horizontal card (flex row with gap)
|
|
632
|
+
|
|
633
|
+
**Examples:**
|
|
634
|
+
|
|
635
|
+
```html
|
|
636
|
+
<!-- Basic card -->
|
|
637
|
+
<div class="card bg-background-thin">
|
|
638
|
+
<p>Card content</p>
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
<!-- Menu card -->
|
|
642
|
+
<div class="card card-menu card-y">
|
|
643
|
+
<button class="btn btn-ghost">Item 1</button>
|
|
644
|
+
<button class="btn btn-ghost">Item 2</button>
|
|
645
|
+
</div>
|
|
646
|
+
|
|
647
|
+
<!-- Horizontal card -->
|
|
648
|
+
<div class="card card-x">
|
|
649
|
+
<span>Left</span>
|
|
650
|
+
<span>Right</span>
|
|
651
|
+
</div>
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
#### Card Sizes
|
|
655
|
+
|
|
656
|
+
Cards inherit element sizing:
|
|
657
|
+
|
|
658
|
+
```html
|
|
659
|
+
<div class="card element-sm">Small card</div>
|
|
660
|
+
<div class="card">Default card</div>
|
|
661
|
+
<div class="card element-lg">Large card</div>
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
---
|
|
665
|
+
|
|
666
|
+
### Badge
|
|
667
|
+
|
|
668
|
+
Badge component for labels and tags.
|
|
669
|
+
|
|
670
|
+
#### Base Badge
|
|
671
|
+
|
|
672
|
+
```html
|
|
673
|
+
<span class="badge">Badge</span>
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
#### Badge Variants
|
|
677
|
+
|
|
678
|
+
- `badge-fill` - Filled badge
|
|
679
|
+
- `badge-outline` - Outlined badge
|
|
680
|
+
- `badge-soft` - Soft badge
|
|
681
|
+
|
|
682
|
+
**Examples:**
|
|
683
|
+
|
|
684
|
+
```html
|
|
685
|
+
<span class="badge badge-fill">New</span>
|
|
686
|
+
<span class="badge badge-outline">Tag</span>
|
|
687
|
+
<span class="badge badge-soft">Label</span>
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
#### Badge Sizes
|
|
691
|
+
|
|
692
|
+
```html
|
|
693
|
+
<span class="badge badge-fill element-xs">XS</span>
|
|
694
|
+
<span class="badge badge-fill element-sm">SM</span>
|
|
695
|
+
<span class="badge badge-fill">Default</span>
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
---
|
|
699
|
+
|
|
700
|
+
### Alert
|
|
701
|
+
|
|
702
|
+
Alert component for notifications and messages.
|
|
703
|
+
|
|
704
|
+
#### Base Alert
|
|
705
|
+
|
|
706
|
+
```html
|
|
707
|
+
<div class="alert">Alert message</div>
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
**Example:**
|
|
711
|
+
|
|
712
|
+
```html
|
|
713
|
+
<div class="alert palette-error">
|
|
714
|
+
<Icon />
|
|
715
|
+
<span>Error message</span>
|
|
716
|
+
</div>
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
#### Alert with Palette
|
|
720
|
+
|
|
721
|
+
```html
|
|
722
|
+
<!-- Error alert -->
|
|
723
|
+
<div class="alert palette-error">Error occurred</div>
|
|
724
|
+
|
|
725
|
+
<!-- Success alert -->
|
|
726
|
+
<div class="alert palette-success">Operation successful</div>
|
|
727
|
+
|
|
728
|
+
<!-- Info alert -->
|
|
729
|
+
<div class="alert palette-info">Information message</div>
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
---
|
|
733
|
+
|
|
734
|
+
### KBD (Keyboard)
|
|
735
|
+
|
|
736
|
+
Display keyboard shortcuts.
|
|
737
|
+
|
|
738
|
+
#### Base KBD
|
|
739
|
+
|
|
740
|
+
```html
|
|
741
|
+
<kbd class="kbd">Ctrl</kbd>
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
**Example:**
|
|
745
|
+
|
|
746
|
+
```html
|
|
747
|
+
<kbd class="kbd">Ctrl</kbd> + <kbd class="kbd">K</kbd>
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
---
|
|
751
|
+
|
|
752
|
+
### Join
|
|
753
|
+
|
|
754
|
+
Join elements together seamlessly.
|
|
755
|
+
|
|
756
|
+
#### Base Join
|
|
757
|
+
|
|
758
|
+
```html
|
|
759
|
+
<div class="join">
|
|
760
|
+
<button class="btn">One</button>
|
|
761
|
+
<button class="btn">Two</button>
|
|
762
|
+
<button class="btn">Three</button>
|
|
763
|
+
</div>
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
#### Join with Border
|
|
767
|
+
|
|
768
|
+
```html
|
|
769
|
+
<div class="join join-border">
|
|
770
|
+
<button class="btn btn-outline">One</button>
|
|
771
|
+
<button class="btn btn-outline">Two</button>
|
|
772
|
+
<button class="btn btn-outline">Three</button>
|
|
773
|
+
</div>
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
#### Join Fix Border
|
|
777
|
+
|
|
778
|
+
Removes double borders:
|
|
779
|
+
|
|
780
|
+
```html
|
|
781
|
+
<div class="join join-border join-fix-border">
|
|
782
|
+
<button class="btn btn-outline">One</button>
|
|
783
|
+
<button class="btn btn-outline">Two</button>
|
|
784
|
+
</div>
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
**Note:** Join automatically handles RTL (right-to-left) layouts.
|
|
788
|
+
|
|
789
|
+
---
|
|
790
|
+
|
|
791
|
+
### Separator
|
|
792
|
+
|
|
793
|
+
Separate content with borders and spacing.
|
|
794
|
+
|
|
795
|
+
#### Separator Directions
|
|
796
|
+
|
|
797
|
+
- `separate-t` - Top separator
|
|
798
|
+
- `separate-r` - Right separator
|
|
799
|
+
- `separate-b` - Bottom separator
|
|
800
|
+
- `separate-l` - Left separator
|
|
801
|
+
- `separate-y` - Vertical separator (top + bottom)
|
|
802
|
+
- `separate-x` - Horizontal separator (left + right)
|
|
803
|
+
|
|
804
|
+
**Examples:**
|
|
805
|
+
|
|
806
|
+
```html
|
|
807
|
+
<!-- Bottom separator -->
|
|
808
|
+
<div class="separate-b">Content with bottom border and spacing</div>
|
|
809
|
+
|
|
810
|
+
<!-- Vertical separator -->
|
|
811
|
+
<div class="separate-y">Content with top and bottom borders</div>
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
---
|
|
815
|
+
|
|
816
|
+
### Position Utilities
|
|
817
|
+
|
|
818
|
+
Position elements relative to their container.
|
|
819
|
+
|
|
820
|
+
#### Individual Positions
|
|
821
|
+
|
|
822
|
+
**Top:**
|
|
823
|
+
|
|
824
|
+
- `top-center` - Center vertically, top edge
|
|
825
|
+
- `top-boundary` - Top boundary
|
|
826
|
+
- `top-out` - Outside top edge
|
|
827
|
+
|
|
828
|
+
**Right:**
|
|
829
|
+
|
|
830
|
+
- `right-center` - Center horizontally, right edge
|
|
831
|
+
- `right-boundary` - Right boundary
|
|
832
|
+
- `right-out` - Outside right edge
|
|
833
|
+
|
|
834
|
+
**Bottom:**
|
|
835
|
+
|
|
836
|
+
- `bottom-center` - Center vertically, bottom edge
|
|
837
|
+
- `bottom-boundary` - Bottom boundary
|
|
838
|
+
- `bottom-out` - Outside bottom edge
|
|
839
|
+
|
|
840
|
+
**Left:**
|
|
841
|
+
|
|
842
|
+
- `left-center` - Center horizontally, left edge
|
|
843
|
+
- `left-boundary` - Left boundary
|
|
844
|
+
- `left-out` - Outside left edge
|
|
845
|
+
|
|
846
|
+
**Center:**
|
|
847
|
+
|
|
848
|
+
- `inset-center` - Perfect center (top-center + left-center)
|
|
849
|
+
|
|
850
|
+
#### Compound Positions
|
|
851
|
+
|
|
852
|
+
- `position-t` - Top center
|
|
853
|
+
- `position-tr` - Top right
|
|
854
|
+
- `position-r` - Right center
|
|
855
|
+
- `position-br` - Bottom right
|
|
856
|
+
- `position-b` - Bottom center
|
|
857
|
+
- `position-bl` - Bottom left
|
|
858
|
+
- `position-l` - Left center
|
|
859
|
+
- `position-tl` - Top left
|
|
860
|
+
|
|
861
|
+
**Example:**
|
|
862
|
+
|
|
863
|
+
```html
|
|
864
|
+
<div class="relative">
|
|
865
|
+
<div class="absolute position-b card">Popover content</div>
|
|
866
|
+
</div>
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
---
|
|
870
|
+
|
|
871
|
+
## Component-Specific Styles
|
|
872
|
+
|
|
873
|
+
### Accordion
|
|
874
|
+
|
|
875
|
+
```html
|
|
876
|
+
<div class="accordion-body">Accordion content</div>
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
---
|
|
880
|
+
|
|
881
|
+
### Modal
|
|
882
|
+
|
|
883
|
+
```html
|
|
884
|
+
<!-- Portal (backdrop) -->
|
|
885
|
+
<div class="modal-portal">
|
|
886
|
+
<!-- Body -->
|
|
887
|
+
<div class="modal-body">
|
|
888
|
+
<!-- Header -->
|
|
889
|
+
<div class="modal-header">Modal Title</div>
|
|
890
|
+
<!-- Content -->
|
|
891
|
+
<div class="modal-content">Modal content</div>
|
|
892
|
+
</div>
|
|
893
|
+
</div>
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
---
|
|
897
|
+
|
|
898
|
+
### Drawer
|
|
899
|
+
|
|
900
|
+
```html
|
|
901
|
+
<!-- Portal (backdrop) -->
|
|
902
|
+
<div class="drawer-portal">
|
|
903
|
+
<!-- Body -->
|
|
904
|
+
<div class="drawer-body">Drawer content</div>
|
|
905
|
+
</div>
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
---
|
|
909
|
+
|
|
910
|
+
### Sheet
|
|
911
|
+
|
|
912
|
+
```html
|
|
913
|
+
<!-- Portal (backdrop) -->
|
|
914
|
+
<div class="sheet-portal">
|
|
915
|
+
<!-- Body -->
|
|
916
|
+
<div class="sheet-body">
|
|
917
|
+
<!-- Header -->
|
|
918
|
+
<div class="sheet-header">
|
|
919
|
+
<div class="sheet-handlebar"></div>
|
|
920
|
+
</div>
|
|
921
|
+
<!-- Content -->
|
|
922
|
+
<div class="sheet-content">Sheet content</div>
|
|
923
|
+
</div>
|
|
924
|
+
</div>
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
---
|
|
928
|
+
|
|
929
|
+
### Popover
|
|
930
|
+
|
|
931
|
+
```html
|
|
932
|
+
<div class="popover">
|
|
933
|
+
<button class="btn">Trigger</button>
|
|
934
|
+
<div class="popover-body position-b card">Popover content</div>
|
|
935
|
+
</div>
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
**Position Classes:**
|
|
939
|
+
|
|
940
|
+
- `position-t` - Top
|
|
941
|
+
- `position-tr` - Top right
|
|
942
|
+
- `position-r` - Right
|
|
943
|
+
- `position-br` - Bottom right
|
|
944
|
+
- `position-b` - Bottom (default)
|
|
945
|
+
- `position-bl` - Bottom left
|
|
946
|
+
- `position-l` - Left
|
|
947
|
+
- `position-tl` - Top left
|
|
948
|
+
|
|
949
|
+
---
|
|
950
|
+
|
|
951
|
+
### Context Menu
|
|
952
|
+
|
|
953
|
+
```html
|
|
954
|
+
<div class="context-menu">
|
|
955
|
+
<div class="context-menu-body card card-menu card-y">
|
|
956
|
+
<button class="btn btn-ghost">Option 1</button>
|
|
957
|
+
<button class="btn btn-ghost">Option 2</button>
|
|
958
|
+
</div>
|
|
959
|
+
</div>
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
**With Navigation:**
|
|
963
|
+
|
|
964
|
+
```html
|
|
965
|
+
<div class="context-menu-navigation card card-menu card-y">
|
|
966
|
+
<button class="btn btn-ghost">Item 1</button>
|
|
967
|
+
<button class="btn btn-ghost">Item 2</button>
|
|
968
|
+
</div>
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
---
|
|
972
|
+
|
|
973
|
+
### SelectBox
|
|
974
|
+
|
|
975
|
+
```html
|
|
976
|
+
<div class="select-box-input input input-outline">
|
|
977
|
+
<ChevronDownIcon />
|
|
978
|
+
<input
|
|
979
|
+
type="text"
|
|
980
|
+
class="input-field"
|
|
981
|
+
placeholder="Select..." />
|
|
982
|
+
<div class="select-box-list card card-y">
|
|
983
|
+
<div class="input input-outline">
|
|
984
|
+
<SearchIcon />
|
|
985
|
+
<input
|
|
986
|
+
type="text"
|
|
987
|
+
class="input-field" />
|
|
988
|
+
</div>
|
|
989
|
+
<button class="select-box-option btn">Option 1</button>
|
|
990
|
+
<button class="select-box-option btn">Option 2</button>
|
|
991
|
+
</div>
|
|
992
|
+
</div>
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
---
|
|
996
|
+
|
|
997
|
+
### Choice
|
|
998
|
+
|
|
999
|
+
Choice component for radio buttons, checkboxes, and switches.
|
|
1000
|
+
|
|
1001
|
+
#### Radio
|
|
1002
|
+
|
|
1003
|
+
```html
|
|
1004
|
+
<div class="choice choice-radio">
|
|
1005
|
+
<span class="choice-radio-trigger"></span>
|
|
1006
|
+
</div>
|
|
1007
|
+
```
|
|
1008
|
+
|
|
1009
|
+
**Sizes:**
|
|
1010
|
+
|
|
1011
|
+
```html
|
|
1012
|
+
<div class="choice choice-radio element-xs"></div>
|
|
1013
|
+
<div class="choice choice-radio element-sm"></div>
|
|
1014
|
+
<div class="choice choice-radio"></div>
|
|
1015
|
+
<div class="choice choice-radio element-lg"></div>
|
|
1016
|
+
<div class="choice choice-radio element-xl"></div>
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
#### Checkbox
|
|
1020
|
+
|
|
1021
|
+
```html
|
|
1022
|
+
<div class="choice choice-checkbox">
|
|
1023
|
+
<span class="choice-checkbox-trigger">
|
|
1024
|
+
<CheckIcon />
|
|
1025
|
+
</span>
|
|
1026
|
+
</div>
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
#### Switch
|
|
1030
|
+
|
|
1031
|
+
```html
|
|
1032
|
+
<div class="choice choice-switch">
|
|
1033
|
+
<span class="choice-switch-trigger"></span>
|
|
1034
|
+
</div>
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
**States:**
|
|
1038
|
+
|
|
1039
|
+
Use `data-state` attribute:
|
|
1040
|
+
|
|
1041
|
+
- `data-state="true"` - Active/checked
|
|
1042
|
+
- `data-state="false"` - Inactive/unchecked
|
|
1043
|
+
|
|
1044
|
+
---
|
|
1045
|
+
|
|
1046
|
+
### Pagination
|
|
1047
|
+
|
|
1048
|
+
```html
|
|
1049
|
+
<div class="pagination">
|
|
1050
|
+
<button class="btn">Prev</button>
|
|
1051
|
+
<button class="btn">1</button>
|
|
1052
|
+
<button class="btn">2</button>
|
|
1053
|
+
<button class="btn">Next</button>
|
|
1054
|
+
</div>
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
---
|
|
1058
|
+
|
|
1059
|
+
### Progress
|
|
1060
|
+
|
|
1061
|
+
```html
|
|
1062
|
+
<div class="progress">
|
|
1063
|
+
<div
|
|
1064
|
+
class="progress-bar"
|
|
1065
|
+
style="width: 45%">
|
|
1066
|
+
45%
|
|
1067
|
+
</div>
|
|
1068
|
+
</div>
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
---
|
|
1072
|
+
|
|
1073
|
+
### Rating
|
|
1074
|
+
|
|
1075
|
+
```html
|
|
1076
|
+
<div class="rating">
|
|
1077
|
+
<button class="rating-items">
|
|
1078
|
+
<StarIcon />
|
|
1079
|
+
</button>
|
|
1080
|
+
</div>
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
---
|
|
1084
|
+
|
|
1085
|
+
### Carousel
|
|
1086
|
+
|
|
1087
|
+
```html
|
|
1088
|
+
<div class="carousel">
|
|
1089
|
+
<!-- Fade overlays -->
|
|
1090
|
+
<div class="carousel-left-fade"></div>
|
|
1091
|
+
<div class="carousel-right-fade"></div>
|
|
1092
|
+
|
|
1093
|
+
<!-- Container -->
|
|
1094
|
+
<div class="carousel-container">
|
|
1095
|
+
<div class="carousel-children card">Item 1</div>
|
|
1096
|
+
<div class="carousel-children card">Item 2</div>
|
|
1097
|
+
</div>
|
|
1098
|
+
</div>
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
**Important:** Children must have `carousel-children` class for proper width calculation.
|
|
1102
|
+
|
|
1103
|
+
---
|
|
1104
|
+
|
|
1105
|
+
### Breadcrumbs
|
|
1106
|
+
|
|
1107
|
+
```html
|
|
1108
|
+
<nav class="breadcrumbs">
|
|
1109
|
+
<div class="breadcrumbs-item">
|
|
1110
|
+
<a
|
|
1111
|
+
href="#"
|
|
1112
|
+
class="btn link"
|
|
1113
|
+
>Home</a
|
|
1114
|
+
>
|
|
1115
|
+
</div>
|
|
1116
|
+
<div class="breadcrumbs-item">
|
|
1117
|
+
<a
|
|
1118
|
+
href="#"
|
|
1119
|
+
class="btn link"
|
|
1120
|
+
>Articles</a
|
|
1121
|
+
>
|
|
1122
|
+
</div>
|
|
1123
|
+
<div class="breadcrumbs-item">
|
|
1124
|
+
<span class="btn btn-fill">Current</span>
|
|
1125
|
+
</div>
|
|
1126
|
+
</nav>
|
|
1127
|
+
```
|
|
1128
|
+
|
|
1129
|
+
---
|
|
1130
|
+
|
|
1131
|
+
### OTP
|
|
1132
|
+
|
|
1133
|
+
```html
|
|
1134
|
+
<div class="otp">
|
|
1135
|
+
<input
|
|
1136
|
+
type="text"
|
|
1137
|
+
class="input input-outline input-square" />
|
|
1138
|
+
<input
|
|
1139
|
+
type="text"
|
|
1140
|
+
class="input input-outline input-square" />
|
|
1141
|
+
<input
|
|
1142
|
+
type="text"
|
|
1143
|
+
class="input input-outline input-square" />
|
|
1144
|
+
</div>
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
---
|
|
1148
|
+
|
|
1149
|
+
### Show More
|
|
1150
|
+
|
|
1151
|
+
```html
|
|
1152
|
+
<div class="relative">
|
|
1153
|
+
<div class="show-more-content">Long content here...</div>
|
|
1154
|
+
<div class="show-more-fade"></div>
|
|
1155
|
+
<button class="btn">Show more</button>
|
|
1156
|
+
</div>
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
---
|
|
1160
|
+
|
|
1161
|
+
### Spoiler
|
|
1162
|
+
|
|
1163
|
+
```html
|
|
1164
|
+
<span class="spoiler">
|
|
1165
|
+
<span class="spoiler-blur">Hidden text</span>
|
|
1166
|
+
</span>
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
**States:**
|
|
1170
|
+
|
|
1171
|
+
- `data-state="false"` - Blurred (default)
|
|
1172
|
+
- `data-state="true"` - Revealed
|
|
1173
|
+
|
|
1174
|
+
---
|
|
1175
|
+
|
|
1176
|
+
### Affix
|
|
1177
|
+
|
|
1178
|
+
```html
|
|
1179
|
+
<button class="affix btn btn-fill">
|
|
1180
|
+
<ArrowUpIcon />
|
|
1181
|
+
</button>
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
**States:**
|
|
1185
|
+
|
|
1186
|
+
- `data-state="false"` - Hidden
|
|
1187
|
+
- `data-state="true"` - Visible
|
|
1188
|
+
|
|
1189
|
+
---
|
|
1190
|
+
|
|
1191
|
+
## Dark Mode
|
|
1192
|
+
|
|
1193
|
+
Dark mode is supported via the `[data-theme="dark"]` attribute.
|
|
1194
|
+
|
|
1195
|
+
### Setup
|
|
1196
|
+
|
|
1197
|
+
```css
|
|
28
1198
|
[data-theme="dark"] {
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--
|
|
1199
|
+
--background: #151515;
|
|
1200
|
+
--background-thin: #303030;
|
|
1201
|
+
--background-thick: #000000;
|
|
1202
|
+
--foreground: #efefef;
|
|
1203
|
+
--foreground-thin: #ffffff;
|
|
1204
|
+
--foreground-thick: #dfdfdf;
|
|
32
1205
|
}
|
|
33
1206
|
|
|
34
1207
|
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
### Usage
|
|
1211
|
+
|
|
1212
|
+
```html
|
|
1213
|
+
<html data-theme="dark">
|
|
1214
|
+
<!-- Dark mode active -->
|
|
1215
|
+
</html>
|
|
1216
|
+
```
|
|
1217
|
+
|
|
1218
|
+
### Dark Mode Utilities
|
|
1219
|
+
|
|
1220
|
+
Use the `dark:` variant:
|
|
1221
|
+
|
|
1222
|
+
```html
|
|
1223
|
+
<div class="bg-background dark:bg-background-thick">Content</div>
|
|
1224
|
+
```
|
|
1225
|
+
|
|
1226
|
+
---
|
|
1227
|
+
|
|
1228
|
+
## Customization
|
|
1229
|
+
|
|
1230
|
+
### Adding Custom Colors
|
|
1231
|
+
|
|
1232
|
+
1. Define CSS variables:
|
|
1233
|
+
|
|
1234
|
+
```css
|
|
1235
|
+
:root {
|
|
1236
|
+
--custom-color: #ff0000;
|
|
1237
|
+
--custom-color-foreground: #ffffff;
|
|
1238
|
+
}
|
|
35
1239
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
--color-
|
|
39
|
-
--color-brush: var(--color-foreground);
|
|
1240
|
+
@theme {
|
|
1241
|
+
--color-custom-color: var(--custom-color);
|
|
1242
|
+
--color-custom-color-foreground: var(--custom-color-foreground);
|
|
40
1243
|
}
|
|
1244
|
+
```
|
|
41
1245
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1246
|
+
2. Create palette utility:
|
|
1247
|
+
|
|
1248
|
+
```css
|
|
1249
|
+
@utility palette-custom-color {
|
|
1250
|
+
--color-palette: var(--color-custom-color);
|
|
1251
|
+
--color-brush: var(--color-custom-color-foreground);
|
|
45
1252
|
}
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
3. Use it:
|
|
46
1256
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1257
|
+
```html
|
|
1258
|
+
<button class="btn btn-fill palette-custom-color">Custom</button>
|
|
1259
|
+
```
|
|
1260
|
+
|
|
1261
|
+
### Custom Element Sizes
|
|
1262
|
+
|
|
1263
|
+
```css
|
|
1264
|
+
:root {
|
|
1265
|
+
--element-xxl-h: calc(var(--spacing) * 16);
|
|
1266
|
+
--element-xxl-spacing: calc(var(--spacing) * 12);
|
|
1267
|
+
--element-xxl-text: var(--text-2xl);
|
|
1268
|
+
--element-xxl-leading: var(--text-2xl--line-height);
|
|
1269
|
+
--element-xxl-rounded: var(--radius-2xl);
|
|
50
1270
|
}
|
|
51
1271
|
|
|
52
|
-
@utility
|
|
53
|
-
--
|
|
54
|
-
--
|
|
1272
|
+
@utility element-xxl {
|
|
1273
|
+
--element-h: var(--element-xxl-h);
|
|
1274
|
+
--element-spacing: var(--element-xxl-spacing);
|
|
1275
|
+
--element-text: var(--element-xxl-text);
|
|
1276
|
+
--element-leading: var(--element-xxl-leading);
|
|
1277
|
+
--element-rounded: var(--element-xxl-rounded);
|
|
55
1278
|
}
|
|
1279
|
+
```
|
|
1280
|
+
|
|
1281
|
+
### Custom Utilities
|
|
56
1282
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
1283
|
+
```css
|
|
1284
|
+
@utility my-custom-utility {
|
|
1285
|
+
@apply bg-palette text-brush p-4 rounded-lg;
|
|
61
1286
|
}
|
|
62
1287
|
```
|
|
63
1288
|
|
|
64
1289
|
---
|
|
65
1290
|
|
|
66
|
-
|
|
1291
|
+
## Best Practices
|
|
67
1292
|
|
|
1293
|
+
### 1. Use Element Sizing System
|
|
1294
|
+
|
|
1295
|
+
Always use element sizing utilities for consistency:
|
|
1296
|
+
|
|
1297
|
+
```html
|
|
1298
|
+
<!-- ✅ Good -->
|
|
1299
|
+
<button class="btn btn-fill element-sm">Small</button>
|
|
1300
|
+
|
|
1301
|
+
<!-- ❌ Avoid -->
|
|
1302
|
+
<button class="btn btn-fill h-8 px-3 text-sm">Small</button>
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
### 2. Use Palette System
|
|
1306
|
+
|
|
1307
|
+
Use palette utilities for dynamic theming:
|
|
1308
|
+
|
|
1309
|
+
```html
|
|
1310
|
+
<!-- ✅ Good -->
|
|
1311
|
+
<button class="btn btn-fill palette-primary">Primary</button>
|
|
1312
|
+
|
|
1313
|
+
<!-- ❌ Avoid -->
|
|
1314
|
+
<button class="btn bg-primary text-primary-foreground">Primary</button>
|
|
1315
|
+
```
|
|
1316
|
+
|
|
1317
|
+
### 3. Responsive Typography
|
|
1318
|
+
|
|
1319
|
+
Use responsive text classes:
|
|
1320
|
+
|
|
1321
|
+
```html
|
|
1322
|
+
<!-- ✅ Good -->
|
|
1323
|
+
<h1 class="text-xl sm:text-2xl lg:text-5xl font-black">Heading</h1>
|
|
1324
|
+
|
|
1325
|
+
<!-- ❌ Avoid -->
|
|
1326
|
+
<h1 class="text-5xl">Heading</h1>
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1329
|
+
### 4. Component Composition
|
|
1330
|
+
|
|
1331
|
+
Combine utilities for complex components:
|
|
1332
|
+
|
|
1333
|
+
```html
|
|
1334
|
+
<!-- ✅ Good -->
|
|
1335
|
+
<div class="card card-menu card-y bg-background-thin">
|
|
1336
|
+
<button class="btn btn-ghost">Item 1</button>
|
|
1337
|
+
<button class="btn btn-ghost">Item 2</button>
|
|
1338
|
+
</div>
|
|
68
1339
|
```
|
|
69
|
-
Media query:
|
|
70
|
-
sm < mobile
|
|
71
|
-
sm > tablet
|
|
72
|
-
lg < tablet
|
|
73
|
-
lg > desktop
|
|
74
1340
|
|
|
75
|
-
|
|
76
|
-
lvl-1: 0.5
|
|
77
|
-
lvl-2: 1.5
|
|
78
|
-
lvl-3: 3
|
|
79
|
-
lvl-4: 6
|
|
80
|
-
lvl-5: 9
|
|
81
|
-
lvl-6: 12
|
|
82
|
-
lvl-7: 16
|
|
83
|
-
lvl-8: 20
|
|
1341
|
+
### 5. Data States
|
|
84
1342
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
lvl-6: 10%
|
|
1343
|
+
Use `data-state` for component states:
|
|
1344
|
+
|
|
1345
|
+
```html
|
|
1346
|
+
<!-- ✅ Good -->
|
|
1347
|
+
<button class="btn data-[state=true]:btn-fill data-[state=false]:btn-soft">Toggle</button>
|
|
1348
|
+
```
|
|
92
1349
|
|
|
93
|
-
|
|
94
|
-
lvl-1: 10
|
|
95
|
-
lvl-2: 20
|
|
96
|
-
lvl-3: 30
|
|
97
|
-
lvl-4: 40
|
|
98
|
-
lvl-5: 50
|
|
1350
|
+
---
|
|
99
1351
|
|
|
100
|
-
|
|
101
|
-
lvl-1: rounded
|
|
102
|
-
lvl-2: rounded-md
|
|
103
|
-
lvl-3: rounded-lg
|
|
104
|
-
lvl-4: rounded-xl
|
|
105
|
-
lvl-5: rounded-2xl
|
|
1352
|
+
## Integration with @kadoui/react
|
|
106
1353
|
|
|
107
|
-
|
|
108
|
-
text-xl sm:text-2xl lg:text-5xl font-black
|
|
1354
|
+
This package is designed to work seamlessly with `@kadoui/react`:
|
|
109
1355
|
|
|
110
|
-
|
|
111
|
-
|
|
1356
|
+
```tsx
|
|
1357
|
+
import { Accordion } from "@kadoui/react";
|
|
112
1358
|
|
|
113
|
-
|
|
114
|
-
|
|
1359
|
+
<Accordion>
|
|
1360
|
+
<Accordion.Toggle className="btn btn-soft">Toggle</Accordion.Toggle>
|
|
1361
|
+
<Accordion.Body className="accordion-body">Content</Accordion.Body>
|
|
1362
|
+
</Accordion>;
|
|
115
1363
|
```
|
|
116
1364
|
|
|
1365
|
+
See [@kadoui/react documentation](https://www.npmjs.com/package/@kadoui/react) for component usage.
|
|
1366
|
+
|
|
117
1367
|
---
|
|
118
1368
|
|
|
119
|
-
|
|
1369
|
+
## Browser Support
|
|
120
1370
|
|
|
121
|
-
|
|
1371
|
+
- Chrome (latest)
|
|
1372
|
+
- Firefox (latest)
|
|
1373
|
+
- Safari (latest)
|
|
1374
|
+
- Edge (latest)
|
|
1375
|
+
|
|
1376
|
+
---
|
|
122
1377
|
|
|
123
|
-
|
|
1378
|
+
## Contributing
|
|
1379
|
+
|
|
1380
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
124
1381
|
|
|
125
1382
|
---
|
|
126
1383
|
|
|
127
|
-
|
|
1384
|
+
## License
|
|
1385
|
+
|
|
1386
|
+
MIT © [Farzad Vahdati](https://github.com/FarzadVav)
|
|
1387
|
+
|
|
1388
|
+
---
|
|
1389
|
+
|
|
1390
|
+
<div align="center">
|
|
1391
|
+
|
|
1392
|
+
Made with ❤️ by [Farzad Vahdati](https://github.com/FarzadVav)
|
|
1393
|
+
|
|
1394
|
+
</div>
|