opsfuse-ui 0.1.6 → 0.1.8

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.
@@ -53,23 +53,23 @@ If the project has `tsconfig.json`, ensure `moduleResolution` is set to `"bundle
53
53
 
54
54
  ### 2a. Import opsfuse styles
55
55
 
56
- Find the app's entry file (e.g. `main.tsx`, `_app.tsx`, `app/layout.tsx`) and add the CSS import that matches the host's Tailwind version, **before the host app's own Tailwind / global stylesheet**. There are two bundles — pick one:
56
+ Find the app's entry file (e.g. `main.tsx`, `_app.tsx`, `app/layout.tsx`) and add the single CSS import **before the host app's own Tailwind / global stylesheet**:
57
57
 
58
58
  ```ts
59
- // Tailwind v3 host (or no Tailwind): flat, un-layered
60
- import "opsfuse-ui/styles.css";
61
- // Tailwind v4 host: cascade-layered
62
- import "opsfuse-ui/styles.layered.css";
59
+ import "opsfuse-ui/styles.css"; // FIRST — before your Tailwind / global CSS
63
60
 
64
61
  import "./index.css"; // your app's `@import "tailwindcss"` etc. — comes AFTER
65
62
  ```
66
63
 
67
64
  For **Next.js App Router** add it first in `app/layout.tsx`; for **Pages Router** add it first in `pages/_app.tsx` — in both cases before `globals.css`.
68
65
 
69
- **Which bundle and why.** Both are precompiled, self-contained CSS (you do not run Tailwind over them). Import opsfuse *before* your own CSS so your rules keep precedence and your `className` overrides on library components still take effect.
66
+ **One bundle, every Tailwind version.** `styles.css` is a single precompiled, self-contained bundle that works on Tailwind v3, v4, and future hosts — there is nothing to choose. (`styles.layered.css` still exists as an identical backward-compat alias; prefer `styles.css`.) You do not run Tailwind over it.
67
+
68
+ **Import it _before_ your own CSS — this is the one rule that matters.** The bundle is fully **flat** (no cascade layers) and entirely **scoped to `.opsfuse-ui`**: its component utilities are single classes that out-specify your host's bare-element preflight (`*{…}`), so library components render with their intended borders, rings, sidebar states, etc. on **both** v3 and v4 — they can't be wiped by your host's reset. Library base resets use `:where(.opsfuse-ui)` (zero specificity), so your own utility classes still win. Importing first means equal-specificity ties resolve in your favor.
69
+
70
+ > The bundle ships **no global preflight** and no global `:root` palette — it never restyles your `html`, `body`, headings, form controls, or your Tailwind theme. A scoped equivalent applies only inside `.opsfuse-ui`, so component normalization is intact with zero document-level side effects.
70
71
 
71
- - **`styles.css` (flat) — Tailwind v3 host.** No `@layer` blocks, so v3's PostCSS never throws `@layer components is used but no matching @tailwind components directive`, and the library's un-layered utility classes correctly out-specify the host's un-layered preflight (`*{padding:0}`, element resets). Do **not** use this on a v4 host: its un-layered utilities would beat the host's layered ones (e.g. library `.px-4` would override your `md:px-8`).
72
- - **`styles.layered.css` — Tailwind v4 host.** The library sits in low-priority `opsfuse-*` cascade layers; imported first, the host's own `base`/`utilities` layers register later and win, so the host's preflight and responsive utilities (`md:*`, `hover:*`) stay authoritative while library components still render correctly.
72
+ > **Overrides:** because library utilities are un-layered, a host can't override a component purely through cascade layers. Override per-component via `className` instead — the library merges it with `cn()` / tailwind-merge, which drops the conflicting class so your value wins cleanly. (This requires components to live inside `<OpsfuseThemeProvider>`, which applies the `.opsfuse-ui` scope the tokens depend on.)
73
73
 
74
74
  ### 2b. Font setup
75
75