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