@splenddev/kreativ-ui 0.3.7 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,18 +31,56 @@ import "@splenddev/kreativ-ui/styles.css";
31
31
  import { KreativUIProvider } from "@splenddev/kreativ-ui";
32
32
 
33
33
  export function App() {
34
- return (
35
- <KreativUIProvider>
36
- {/* your application */}
37
- </KreativUIProvider>
38
- );
34
+ return <KreativUIProvider>{/* your application */}</KreativUIProvider>;
39
35
  }
40
36
  ```
41
37
 
38
+ ## Tailwind setup
39
+
40
+ Kreativ UI's components use Tailwind utility classes, including responsive (`md:`) and state (`hover:`, `focus:`) variants. The package ships a prebuilt `styles.css`, but **if your app also uses Tailwind**, don't rely on the prebuilt CSS alone — make sure your own Tailwind build also generates Kreativ UI's utilities, so everything comes from one correctly-ordered stylesheet.
41
+
42
+ ### Tailwind v4
43
+
44
+ Add an `@source` directive in your main CSS entry file (wherever you have `@import "tailwindcss"`):
45
+
46
+ ```css
47
+ @import "tailwindcss";
48
+ @source "../node_modules/@splenddev/kreativ-ui/dist";
49
+ ```
50
+
51
+ Adjust the relative path to match your project structure.
52
+
53
+ ### Tailwind v3
54
+
55
+ Add Kreativ UI to your `content` array:
56
+
57
+ ```js
58
+ // tailwind.config.js
59
+ export default {
60
+ content: [
61
+ "./src/**/*.{ts,tsx}",
62
+ "./node_modules/@splenddev/kreativ-ui/dist/**/*.{js,cjs}",
63
+ ],
64
+ // ...
65
+ };
66
+ ```
67
+
68
+ ### Why this matters
69
+
70
+ If your app's Tailwind output and Kreativ UI's prebuilt `styles.css` are loaded as two separate stylesheets, utilities with equal CSS specificity resolve by **source order**, not by whether one is wrapped in a media query or pseudo-class. A plain `.inline-flex` from your app's stylesheet can end up ordered after — and therefore override — a responsive `md:hidden` or state variant shipped in Kreativ UI's CSS, even though the media query matches. This shows up as variants (`md:hidden`, `hover:*`, etc.) silently not applying, with `!` (`md:hidden!`) appearing to "fix" it by brute-forcing `!important`.
71
+
72
+ Scanning Kreativ UI into your own build avoids this entirely — one Tailwind build, one correctly ordered stylesheet, no conflicts. You can then skip importing `@splenddev/kreativ-ui/styles.css` for utility classes; still import it if you rely on Kreativ UI's CSS custom properties, keyframes, or `[data-kui-*]` attribute-selector styles that aren't generated from your own usage.
73
+
42
74
  ## Quick start
43
75
 
44
76
  ```tsx
45
- import { Button, Card, Input, Stack, KreativUIProvider } from "@splenddev/kreativ-ui";
77
+ import {
78
+ Button,
79
+ Card,
80
+ Input,
81
+ Stack,
82
+ KreativUIProvider,
83
+ } from "@splenddev/kreativ-ui";
46
84
 
47
85
  export default function App() {
48
86
  return (
@@ -141,11 +179,7 @@ const theme = {
141
179
  };
142
180
 
143
181
  export function App() {
144
- return (
145
- <KreativUIProvider theme={theme}>
146
- ...
147
- </KreativUIProvider>
148
- );
182
+ return <KreativUIProvider theme={theme}>...</KreativUIProvider>;
149
183
  }
150
184
  ```
151
185