Skip to content

Commit 2105ea1

Browse files
docs: update nuxt documentation and branding (tailwindlabs#1678)
* chore: update `Nuxt.js` to `Nuxt` * chore: update nuxt logo * chore: make current nuxt version first in list * feat: use `@nuxtjs/tailwindcss` module + nuxi cli * Update logo All logos are in a 40⨉40 bounding box with surrounding whitespace to ensure the logo is visible at all times * Bring back original version as a separate tab * Update urls * Update src/pages/docs/guides/nuxtjs.js Co-authored-by: Daniel Roe <daniel@roe.dev> * Update guide * Tweak wording * Tweak wording again This better matches the other guides with similar wording --------- Co-authored-by: Jordan Pittman <jordan@cryptica.me>
1 parent 3146d66 commit 2105ea1

File tree

4 files changed

+55
-138
lines changed

4 files changed

+55
-138
lines changed

src/img/guides/nuxtjs.svg

Lines changed: 2 additions & 3 deletions
Loading

src/pages/docs/guides/nuxtjs.js

Lines changed: 49 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,34 @@ import { TabBar } from '@/components/Guides/TabBar.jsx'
66

77
let tabs = [
88
{
9-
name: 'Nuxt 2',
10-
href: '#2',
9+
name: 'Standard installation',
10+
href: '#standard',
1111
steps: [
1212
{
1313
title: 'Create your project',
1414
body: () => (
1515
<p>
16-
Start by creating a new Nuxt.js project if you don’t have one set up already. The most
17-
common approach is to use{' '}
18-
<a href="https://nuxtjs.org/guides/get-started/installation">Create Nuxt App</a>.
16+
Start by creating a new Nuxt project if you don’t have one set up already. The most
17+
common approach is to use the{' '}
18+
<a href="https://nuxt.com/docs/getting-started/installation">
19+
Nuxt Command Line Interface
20+
</a>
21+
.
1922
</p>
2023
),
2124
code: {
2225
name: 'Terminal',
2326
lang: 'terminal',
24-
code: 'npx create-nuxt-app my-project\ncd my-project',
27+
code: 'npx nuxi init my-project\ncd my-project',
2528
},
2629
},
2730
{
2831
title: 'Install Tailwind CSS',
2932
body: () => (
30-
<>
31-
<p>
32-
Install <code>tailwindcss</code> and its peer dependencies via npm, and then run the
33-
init command to generate a <code>tailwind.config.js</code> file.
34-
</p>
35-
</>
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.
36+
</p>
3637
),
3738
code: {
3839
name: 'Terminal',
@@ -45,24 +46,22 @@ let tabs = [
4546
body: () => (
4647
<p>
4748
Add <code>tailwindcss</code> and <code>autoprefixer</code> to the{' '}
48-
<code>build.postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
49+
<code>postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
4950
</p>
5051
),
5152
code: {
5253
name: 'nuxt.config.js',
5354
lang: 'js',
54-
code: ` export default {
55-
build: {
56-
> postcss: {
57-
> postcssOptions: {
58-
> plugins: {
59-
> tailwindcss: {},
60-
> autoprefixer: {},
61-
> },
62-
> },
55+
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
56+
export default defineNuxtConfig({
57+
devtools: { enabled: true },
58+
> postcss: {
59+
> plugins: {
60+
> tailwindcss: {},
61+
> autoprefixer: {},
6362
> },
64-
}
65-
}`,
63+
> },
64+
})`,
6665
},
6766
},
6867
{
@@ -83,7 +82,7 @@ let tabs = [
8382
> "./layouts/**/*.vue",
8483
> "./pages/**/*.vue",
8584
> "./plugins/**/*.{js,ts}",
86-
> "./nuxt.config.{js,ts}",
85+
> "./app.vue",
8786
> ],
8887
theme: {
8988
extend: {},
@@ -107,21 +106,27 @@ let tabs = [
107106
},
108107
},
109108
{
110-
title: 'Import the CSS file',
109+
title: 'Add the CSS file globally',
111110
body: () => (
112111
<p>
113-
Add the newly-created <code>./assets/css/main.css</code> file to the <code>css</code>{' '}
114-
array in the <code>nuxt.config.js</code> file.
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.
115114
</p>
116115
),
117116
code: {
118117
name: 'nuxt.config.js',
119118
lang: 'js',
120-
code: ` export default {
121-
css: [
122-
> '@/assets/css/main.css',
123-
],
124-
}`,
119+
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
120+
export default defineNuxtConfig({
121+
devtools: { enabled: true },
122+
> css: ['~/assets/css/main.css'],
123+
postcss: {
124+
plugins: {
125+
tailwindcss: {},
126+
autoprefixer: {},
127+
},
128+
},
129+
})`,
125130
},
126131
},
127132
{
@@ -141,7 +146,7 @@ let tabs = [
141146
title: 'Start using Tailwind in your project',
142147
body: () => <p>Start using Tailwind’s utility classes to style your content.</p>,
143148
code: {
144-
name: 'App.vue',
149+
name: 'app.vue',
145150
lang: 'html',
146151
code: ` <template>
147152
> <h1 class="text-3xl font-bold underline">
@@ -153,14 +158,14 @@ let tabs = [
153158
],
154159
},
155160
{
156-
name: 'Nuxt 3',
157-
href: '#3',
161+
name: 'Using Nuxt Modules',
162+
href: '#modules',
158163
steps: [
159164
{
160165
title: 'Create your project',
161166
body: () => (
162167
<p>
163-
Start by creating a new Nuxt.js project if you don’t have one set up already. The most
168+
Start by creating a new Nuxt project if you don’t have one set up already. The most
164169
common approach is to use the{' '}
165170
<a href="https://nuxt.com/docs/getting-started/installation">
166171
Nuxt Command Line Interface
@@ -178,101 +183,14 @@ let tabs = [
178183
title: 'Install Tailwind CSS',
179184
body: () => (
180185
<p>
181-
Install <code>tailwindcss</code> and its peer dependencies via npm, and then run the
182-
init command to generate a <code>tailwind.config.js</code> file.
186+
Using nuxi, install the <code>@nuxtjs/tailwindcss</code> module and then run the init
187+
command to generate a <code>tailwind.config.js</code> file.
183188
</p>
184189
),
185190
code: {
186191
name: 'Terminal',
187192
lang: 'terminal',
188-
code: 'npm install -D tailwindcss postcss autoprefixer\nnpx tailwindcss init',
189-
},
190-
},
191-
{
192-
title: 'Add Tailwind to your PostCSS configuration',
193-
body: () => (
194-
<p>
195-
Add <code>tailwindcss</code> and <code>autoprefixer</code> to the{' '}
196-
<code>postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
197-
</p>
198-
),
199-
code: {
200-
name: 'nuxt.config.js',
201-
lang: 'js',
202-
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
203-
export default defineNuxtConfig({
204-
> postcss: {
205-
> plugins: {
206-
> tailwindcss: {},
207-
> autoprefixer: {},
208-
> },
209-
> },
210-
})`,
211-
},
212-
},
213-
{
214-
title: 'Configure your template paths',
215-
body: () => (
216-
<p>
217-
Add the paths to all of your template files in your <code>tailwind.config.js</code>{' '}
218-
file.
219-
</p>
220-
),
221-
code: {
222-
name: 'tailwind.config.js',
223-
lang: 'js',
224-
code: ` /** @type {import('tailwindcss').Config} */
225-
module.exports = {
226-
> content: [
227-
> "./components/**/*.{js,vue,ts}",
228-
> "./layouts/**/*.vue",
229-
> "./pages/**/*.vue",
230-
> "./plugins/**/*.{js,ts}",
231-
> "./nuxt.config.{js,ts}",
232-
> "./app.vue",
233-
> ],
234-
theme: {
235-
extend: {},
236-
},
237-
plugins: [],
238-
}`,
239-
},
240-
},
241-
{
242-
title: 'Add the Tailwind directives to your CSS',
243-
body: () => (
244-
<p>
245-
Create an <code>./assets/css/main.css</code> file and add the <code>@tailwind</code>{' '}
246-
directives for each of Tailwind’s layers.
247-
</p>
248-
),
249-
code: {
250-
name: 'main.css',
251-
lang: 'css',
252-
code: '@tailwind base;\n@tailwind components;\n@tailwind utilities;',
253-
},
254-
},
255-
{
256-
title: 'Add the CSS file globally',
257-
body: () => (
258-
<p>
259-
Add your newly-created <code>./assets/css/main.css</code> to the <code>css</code> array
260-
in your <code>nuxt.config.js</code> file.
261-
</p>
262-
),
263-
code: {
264-
name: 'nuxt.config.js',
265-
lang: 'js',
266-
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
267-
export default defineNuxtConfig({
268-
> css: ['~/assets/css/main.css'],
269-
postcss: {
270-
plugins: {
271-
tailwindcss: {},
272-
autoprefixer: {},
273-
},
274-
},
275-
})`,
193+
code: 'npm install\nnpx nuxi module add @nuxtjs/tailwindcss\nnpx tailwindcss init',
276194
},
277195
},
278196
{
@@ -316,8 +234,8 @@ export default function UsingNuxtJs({ code }) {
316234

317235
return (
318236
<FrameworkGuideLayout
319-
title="Install Tailwind CSS with Nuxt.js"
320-
description="Setting up Tailwind CSS in a Nuxt.js project."
237+
title="Install Tailwind CSS with Nuxt"
238+
description="Setting up Tailwind CSS in a Nuxt project."
321239
>
322240
<TabBar tabs={tabs} selectedTabIndex={selectedTabIndex} />
323241
<Steps steps={tabs[selectedTabIndex].steps} code={code[selectedTabIndex]} />
@@ -337,8 +255,8 @@ export function getStaticProps() {
337255

338256
UsingNuxtJs.layoutProps = {
339257
meta: {
340-
title: 'Install Tailwind CSS with Nuxt.js',
341-
description: 'Setting up Tailwind CSS in a Nuxt.js project.',
258+
title: 'Install Tailwind CSS with Nuxt',
259+
description: 'Setting up Tailwind CSS in a Nuxt project.',
342260
section: 'Installation',
343261
},
344262
Layout: DocumentationLayout,

src/pages/docs/installation/framework-guides.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function FrameworkGuides() {
6060
logo: ViteLogo,
6161
},
6262
{
63-
name: 'Nuxt.js',
63+
name: 'Nuxt',
6464
slug: 'nuxtjs',
6565
description: 'Intuitive Vue framework for building universal applications.',
6666
logo: NuxtJsLogo,

src/pages/showcase/keepgrading/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ export const meta = {
55
ogImage: require('./og.jpg'),
66
image: require('./1.png'),
77
imageAlt: 'Screenshot from the animated introduction to the KeepGrading website.',
8-
tech: 'Tailwind CSS, Nuxt.js, Vue',
9-
description: 'KeepGrading is a post-production studio focused on color grading. Based in Paris, France, KeepGrading works with some of the World\'s largest brands and artists. The KeepGrading website is built on Nuxt.js and uses Tailwind CSS.',
8+
tech: 'Tailwind CSS, Nuxt, Vue',
9+
description: 'KeepGrading is a post-production studio focused on color grading. Based in Paris, France, KeepGrading works with some of the World\'s largest brands and artists. The KeepGrading website is built on Nuxt and uses Tailwind CSS.',
1010
}
1111

1212
<Intro title="Post-production for Justin Bieber and Louis Vuitton.">
1313

14-
KeepGrading is a post-production studio focused on color grading. Based in Paris, France, KeepGrading works with some of the World's largest brands and artists. The KeepGrading website is built on Nuxt.js and uses Tailwind CSS.
14+
KeepGrading is a post-production studio focused on color grading. Based in Paris, France, KeepGrading works with some of the World's largest brands and artists. The KeepGrading website is built on Nuxt and uses Tailwind CSS.
1515

1616
</Intro>
1717

0 commit comments

Comments
 (0)