@@ -31,101 +31,13 @@ let tabs = [
31
31
title : 'Install Tailwind CSS' ,
32
32
body : ( ) => (
33
33
< 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.
36
35
</ p >
37
36
) ,
38
37
code : {
39
38
name : 'Terminal' ,
40
39
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' ,
129
41
} ,
130
42
} ,
131
43
{
0 commit comments