You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finally, you'll need to add CSS directives to add each Tailwind layer to `src/style.css`. Since Storefront UI fits into your Tailwind workflow, you'll need to add Tailwind's base, components, and utilities layers to your CSS.
92
91
93
-
94
92
```css
95
93
/* src/style.css */
96
94
@tailwind base;
@@ -102,89 +100,78 @@ Finally, you'll need to add CSS directives to add each Tailwind layer to `src/st
102
100
103
101
Now, you can import Storefront UI components in your app and all the Tailwind utilities from the `@storefront-ui/vue` library will be available in your project.
With Nuxt 3, the fastest way to get started is to use the `@nuxtjs/tailwindcss` module. The [Nuxt Tailwind module](https://tailwindcss.nuxtjs.org/) will automatically install Tailwind CSS and PostCSS for you.
124
-
125
-
Additionally, you'll need to install the Storefront UI's Vue library and Tailwind preset.
113
+
With Nuxt 3, the fastest way to get started is to use the `@storefront-ui/nuxt` module. The [Storefront-io Nuxt module](https://www.npmjs.com/package/@storefront-ui/nuxt) will automatically install `@nuxtjs/tailwindcss` inside `nuxt` and storefront-ui tailwindcss presets.
### Add the Nuxt Tailwind module to your `nuxt.config.ts`
139
127
140
128
```ts
141
129
// nuxt.config.ts
142
130
exportdefaultdefineNuxtConfig({
143
-
modules: ['@nuxtjs/tailwindcss']
131
+
modules: ['@storefront-ui/nuxt']
144
132
})
145
133
```
146
134
147
-
### Modify your `tailwind.config.ts`
135
+
### Tailwind configuration
148
136
149
-
Storefront UI plugs into your Tailwind configuration to add any base styles and CSS variables. To do this, you need to import the Storefront UI Tailwind preset and add it to your`tailwind.config.ts` file.
137
+
Since we use `@nuxtjs/tailwindcss` under the hood, there is possibility to use `tailwindcss` property in `nuxt.config.ts` file. Other than that there is default `tailwind` way to create config via`tailwind.config.ts` file.
150
138
151
-
::tip Add a path to your installed package
139
+
Internally, `@nuxtjs/tailwindcss` will merge the three places that you can add configurations. In order of priority, the options are:
152
140
141
+
1.`tailwind.config.ts` file
142
+
2.`nuxt.config.ts` file with `tailwindcss` property
In order for Tailwind to properly detect the utility classes used in Storefront UI components, you need to add a path to wherever your `node_modules` folder is located to the `content` property. In the example below, we're using the default location for `node_modules`, but this may change if you're working in a monorepo.
Finally, you'll need to add CSS directives to add each Tailwind layer to `src/style.css`. Since Storefront UI fits into your Tailwind workflow, you'll need to add Tailwind's base, components, and utilities layers to your CSS.
158
+
### Custom `tailwind.css` file
169
159
160
+
If you're going to create your own Tailwind CSS file, make sure to add the @tailwind directives for each of Tailwind’s layer types (base, components, and utilities).
170
161
171
162
```css
172
-
/*src/style.css */
163
+
/*~/assets/css/tailwind.css */
173
164
@tailwind base;
174
165
@tailwind components;
175
166
@tailwind utilities;
176
167
```
177
168
178
169
### You're ready to go
179
170
180
-
Now, you can import Storefront UI components in your app and all the Tailwind utilities from the `@storefront-ui/vue` library will be available in your project.
181
-
182
-
171
+
Now, you can import Storefront UI components in your app and all the Tailwind utilities from the `@storefront-ui/vue` library will be available in your project. Because `storefront-ui` is served as well from module, `@storefront-ui/vue` is available from [Nuxt autoimport](https://nuxt.com/docs/guide/concepts/auto-imports).
Finally, you'll need to add CSS directives to add each Tailwind layer to `src/style.css`. Since Storefront UI fits into your Tailwind workflow, you'll need to add Tailwind's base, components, and utilities layers to your CSS.
255
242
256
-
257
243
```css
258
244
/* src/style.css */
259
245
@tailwind base;
@@ -265,14 +251,8 @@ Finally, you'll need to add CSS directives to add each Tailwind layer to `src/st
265
251
266
252
You can now import Storefront UI components inside your Astro project! You can either use them directly in your Astro components or import them into your Vue components.
@@ -281,8 +261,6 @@ import { SfButton } from '@storefront-ui/vue';
281
261
<SfButton> Hello </SfButton>
282
262
```
283
263
284
-
285
-
286
264
::tip Need interaction?
287
265
If you need interaction, you can create your own Vue components that use Storefront UI components under the hood. You can then import these components into your Astro components and use them as you would any other Vue component. Read more about Vue components in Astro in Astro's [Framework Components guide](https://docs.astro.build/en/core-concepts/framework-components/).
Copy file name to clipboardExpand all lines: packages/sfui/frameworks/nuxt/CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
# @storefront-ui/nuxt
2
2
3
+
## 2.5.0
4
+
5
+
### Minor Changes
6
+
7
+
-[#3155](https://github.com/vuestorefront/storefront-ui/pull/3155)[`a754c14`](https://github.com/vuestorefront/storefront-ui/commit/a754c147597bdc9a5af9fb635d59add8873f7178) Thanks [@Szymon-dziewonski](https://github.com/Szymon-dziewonski)! - [FIXED]`nuxt` module package is working, installation documentation of storefront-ui on nuxt is set to use module by default, add `eslint` lint, add `README.md` file. Previously nuxt module on npm contained only `CHANGELOG.md` and `package.json` files.
8
+
9
+
## 2.5.0-rc.0
10
+
11
+
### Minor Changes
12
+
13
+
-[#3155](https://github.com/vuestorefront/storefront-ui/pull/3155)[`a754c14`](https://github.com/vuestorefront/storefront-ui/commit/a754c147597bdc9a5af9fb635d59add8873f7178) Thanks [@Szymon-dziewonski](https://github.com/Szymon-dziewonski)! - [FIXED]`nuxt` module package is working, installation documentation of storefront-ui on nuxt is set to use module by default, add `eslint` lint, add `README.md` file. Previously nuxt module on npm contained only `CHANGELOG.md` and `package.json` files.
0 commit comments