opsfuse-ui 0.1.5 → 0.1.7
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,21 @@ 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
|
|
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
|
-
//
|
|
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
|
-
**
|
|
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 library wraps all its CSS in a single low-priority `@layer opsfuse`. Imported first, your host Tailwind registers later, so on a **v4 host** its layers win and on a **v3 host** its un-layered utilities win — either way your `className` overrides on library components (`md:px-8`, `bg-red-500`, hover/responsive variants) stay authoritative. The library's design tokens, themed borders, and heading typography are emitted un-layered + scoped to `.opsfuse-ui`, so they survive your host's preflight without leaking into or overriding the rest of your app.
|
|
70
69
|
|
|
71
|
-
|
|
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.
|
|
70
|
+
> The bundle ships **no global preflight** — it never restyles your `html`, `body`, headings, or form controls. A scoped equivalent applies only inside `.opsfuse-ui`, so component normalization is intact with zero document-level side effects.
|
|
73
71
|
|
|
74
72
|
### 2b. Font setup
|
|
75
73
|
|