Skip to content

Commit 35740c7

Browse files
committed
feat: use @nuxtjs/tailwindcss module + nuxi cli
1 parent d189f90 commit 35740c7

File tree

1 file changed

+2
-90
lines changed

1 file changed

+2
-90
lines changed

src/pages/docs/guides/nuxtjs.js

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -31,101 +31,13 @@ let tabs = [
3131
title: 'Install Tailwind CSS',
3232
body: () => (
3333
<p>
34-
Install <code>tailwindcss</code> and its peer dependencies via npm, and then run the
35-
init command to generate a <code>tailwind.config.js</code> file.
34+
Install the <code>@nuxtjs/tailwindcss</code> module.
3635
</p>
3736
),
3837
code: {
3938
name: 'Terminal',
4039
lang: 'terminal',
41-
code: 'npm install -D tailwindcss postcss autoprefixer\nnpx tailwindcss init',
42-
},
43-
},
44-
{
45-
title: 'Add Tailwind to your PostCSS configuration',
46-
body: () => (
47-
<p>
48-
Add <code>tailwindcss</code> and <code>autoprefixer</code> to the{' '}
49-
<code>postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
50-
</p>
51-
),
52-
code: {
53-
name: 'nuxt.config.js',
54-
lang: 'js',
55-
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
56-
export default defineNuxtConfig({
57-
> postcss: {
58-
> plugins: {
59-
> tailwindcss: {},
60-
> autoprefixer: {},
61-
> },
62-
> },
63-
})`,
64-
},
65-
},
66-
{
67-
title: 'Configure your template paths',
68-
body: () => (
69-
<p>
70-
Add the paths to all of your template files in your <code>tailwind.config.js</code>{' '}
71-
file.
72-
</p>
73-
),
74-
code: {
75-
name: 'tailwind.config.js',
76-
lang: 'js',
77-
code: ` /** @type {import('tailwindcss').Config} */
78-
module.exports = {
79-
> content: [
80-
> "./components/**/*.{js,vue,ts}",
81-
> "./layouts/**/*.vue",
82-
> "./pages/**/*.vue",
83-
> "./plugins/**/*.{js,ts}",
84-
> "./nuxt.config.{js,ts}",
85-
> "./app.vue",
86-
> ],
87-
theme: {
88-
extend: {},
89-
},
90-
plugins: [],
91-
}`,
92-
},
93-
},
94-
{
95-
title: 'Add the Tailwind directives to your CSS',
96-
body: () => (
97-
<p>
98-
Create an <code>./assets/css/main.css</code> file and add the <code>@tailwind</code>{' '}
99-
directives for each of Tailwind’s layers.
100-
</p>
101-
),
102-
code: {
103-
name: 'main.css',
104-
lang: 'css',
105-
code: '@tailwind base;\n@tailwind components;\n@tailwind utilities;',
106-
},
107-
},
108-
{
109-
title: 'Add the CSS file globally',
110-
body: () => (
111-
<p>
112-
Add your newly-created <code>./assets/css/main.css</code> to the <code>css</code> array
113-
in your <code>nuxt.config.js</code> file.
114-
</p>
115-
),
116-
code: {
117-
name: 'nuxt.config.js',
118-
lang: 'js',
119-
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
120-
export default defineNuxtConfig({
121-
> css: ['~/assets/css/main.css'],
122-
postcss: {
123-
plugins: {
124-
tailwindcss: {},
125-
autoprefixer: {},
126-
},
127-
},
128-
})`,
40+
code: 'npx nuxi module add @nuxtjs/tailwindcss',
12941
},
13042
},
13143
{

0 commit comments

Comments
 (0)