@nxgt/material-vue 0.2.0 → 0.3.1

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
@@ -5,49 +5,62 @@ drag-and-drop, i18n, and `Icon`. Tailwind CSS v4 + shadcn-vue (Reka UI).
5
5
 
6
6
  This package is the Vue mirror of [`@nxgt/material`](https://github.com/softistx/nxgt-material).
7
7
 
8
- ## Nuxt
8
+ ## Styles
9
9
 
10
- ```ts
11
- export default defineNuxtConfig({
12
- modules: ['@nxgt/material-vue/nuxt'],
13
- css: ['~/assets/css/main.css'],
14
- nxgtMaterial: {
15
- // prefix: 'Nxgt',
16
- // css: true,
17
- },
18
- });
19
- ```
10
+ Import the stylesheet **explicitly**, in your Tailwind v4 entry, right after
11
+ `@import "tailwindcss"`:
20
12
 
21
13
  ```css
22
- /* app/assets/css/main.css — Tailwind v4 entry */
14
+ /* app/assets/css/main.css */
23
15
  @import "tailwindcss";
16
+ @import "@nxgt/material-vue/styles.css";
24
17
  ```
25
18
 
26
- The module:
19
+ Nothing injects it for you, on purpose:
27
20
 
28
- - Injects `@import "@nxgt/material-vue/styles.css"` **into that Tailwind entry**
29
- (immediately after `@import "tailwindcss"`). `@theme` / `@utility` only work
30
- in the same CSS graph as Tailwind, so a separate `nuxt.options.css` entry
31
- does not apply tokens.
32
- - Auto-imports components and composables
33
- - Installs Pinia when the host app has none
21
+ - Tailwind v4 builds **one** `@theme` from a single CSS graph. `@theme` /
22
+ `@utility` only apply when `styles.css` is imported in the same file as
23
+ `@import "tailwindcss"`; a second stylesheet (for example another Nuxt
24
+ `css[]` entry) starts a second pipeline, and the tokens never reach the app.
25
+ - Tailwind CSS IntelliSense reads the theme from that entry file. An explicit
26
+ import lets it autocomplete the library tokens (`bg-primary`,
27
+ `text-error-foreground`, `rounded-lg`, …) in your templates.
28
+
29
+ Tailwind v4 does not scan `node_modules`. `styles.css` already declares
30
+ `@source "../dist"`, so the utilities used inside the components are generated
31
+ by your build: no extra `@source` needed.
32
+
33
+ ### Stylesheets
34
34
 
35
- You do **not** need to `@import "@nxgt/material-vue/styles.css"` yourself.
35
+ | Import | What is in it |
36
+ | --- | --- |
37
+ | `@import "@nxgt/material-vue/styles.css"` | source Tailwind v4 tokens, `@theme`, `@utility`: **this** is what a Tailwind app imports |
38
+ | `@import "@nxgt/material-vue"` | `style` condition of the root export → `dist/material-vue.css`: compiled, self-contained CSS (tokens + every utility the components use), for apps without Tailwind |
36
39
 
37
- To manage the import manually:
40
+ Do not import both in the same app.
41
+
42
+ ## Nuxt
38
43
 
39
44
  ```ts
40
45
  export default defineNuxtConfig({
41
46
  modules: ['@nxgt/material-vue/nuxt'],
42
- nxgtMaterial: { css: false },
47
+ css: ['~/assets/css/main.css'], // imports styles.css, see above
48
+ vite: { plugins: [tailwindcss()] },
49
+ nxgtMaterial: {
50
+ // prefix: 'Nxgt',
51
+ },
43
52
  });
44
53
  ```
45
54
 
46
- ```css
47
- @import "tailwindcss";
48
- @import "@nxgt/material-vue/styles.css";
49
- ```
55
+ The module:
56
+
57
+ - Auto-imports components and composables
58
+ - Installs Pinia when the host app has none
59
+ - Pre-bundles CommonJS dependencies (`jsbarcode`) for Vite
60
+
61
+ It does **not** add the stylesheet: import it yourself as shown in
62
+ [Styles](#styles).
50
63
 
51
64
  ## Status
52
65
 
53
- Published on npm. Pin a version in the consumer (`^0.1.0`).
66
+ Published on npm. Pin a version in the consumer (`^0.2.0`).
@@ -1,4 +1,4 @@
1
- import { Dl as e, Tl as t, wl as n } from "./components-Cd9cMyAH.js";
1
+ import { Dl as e, Tl as t, wl as n } from "./components-Cbdud8WI.js";
2
2
  import { t as r } from "./utils-Cy-ByIEo.js";
3
3
  import { r as i, t as a } from "./icon-button-Ghucx7Ah.js";
4
4
  import { n as o } from "./i18n-DXZMN9FA.js";