Skip to content

docs: update nuxt documentation and branding #1678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/img/guides/nuxtjs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 49 additions & 131 deletions src/pages/docs/guides/nuxtjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,34 @@ import { TabBar } from '@/components/Guides/TabBar.jsx'

let tabs = [
{
name: 'Nuxt 2',
href: '#2',
name: 'Standard installation',
href: '#standard',
steps: [
{
title: 'Create your project',
body: () => (
<p>
Start by creating a new Nuxt.js project if you don’t have one set up already. The most
common approach is to use{' '}
<a href="https://nuxtjs.org/guides/get-started/installation">Create Nuxt App</a>.
Start by creating a new Nuxt project if you don’t have one set up already. The most
common approach is to use the{' '}
<a href="https://nuxt.com/docs/getting-started/installation">
Nuxt Command Line Interface
</a>
.
</p>
),
code: {
name: 'Terminal',
lang: 'terminal',
code: 'npx create-nuxt-app my-project\ncd my-project',
code: 'npx nuxi init my-project\ncd my-project',
},
},
{
title: 'Install Tailwind CSS',
body: () => (
<>
<p>
Install <code>tailwindcss</code> and its peer dependencies via npm, and then run the
init command to generate a <code>tailwind.config.js</code> file.
</p>
</>
<p>
Install <code>tailwindcss</code> and its peer dependencies via npm, and then run the
init command to generate a <code>tailwind.config.js</code> file.
</p>
),
code: {
name: 'Terminal',
Expand All @@ -45,24 +46,22 @@ let tabs = [
body: () => (
<p>
Add <code>tailwindcss</code> and <code>autoprefixer</code> to the{' '}
<code>build.postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
<code>postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
</p>
),
code: {
name: 'nuxt.config.js',
lang: 'js',
code: ` export default {
build: {
> postcss: {
> postcssOptions: {
> plugins: {
> tailwindcss: {},
> autoprefixer: {},
> },
> },
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
> postcss: {
> plugins: {
> tailwindcss: {},
> autoprefixer: {},
> },
}
}`,
> },
})`,
},
},
{
Expand All @@ -83,7 +82,7 @@ let tabs = [
> "./layouts/**/*.vue",
> "./pages/**/*.vue",
> "./plugins/**/*.{js,ts}",
> "./nuxt.config.{js,ts}",
> "./app.vue",
> ],
theme: {
extend: {},
Expand All @@ -107,21 +106,27 @@ let tabs = [
},
},
{
title: 'Import the CSS file',
title: 'Add the CSS file globally',
body: () => (
<p>
Add the newly-created <code>./assets/css/main.css</code> file to the <code>css</code>{' '}
array in the <code>nuxt.config.js</code> file.
Add your newly-created <code>./assets/css/main.css</code> to the <code>css</code> array
in your <code>nuxt.config.js</code> file.
</p>
),
code: {
name: 'nuxt.config.js',
lang: 'js',
code: ` export default {
css: [
> '@/assets/css/main.css',
],
}`,
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
> css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
})`,
},
},
{
Expand All @@ -141,7 +146,7 @@ let tabs = [
title: 'Start using Tailwind in your project',
body: () => <p>Start using Tailwind’s utility classes to style your content.</p>,
code: {
name: 'App.vue',
name: 'app.vue',
lang: 'html',
code: ` <template>
> <h1 class="text-3xl font-bold underline">
Expand All @@ -153,14 +158,14 @@ let tabs = [
],
},
{
name: 'Nuxt 3',
href: '#3',
name: 'Using Nuxt Modules',
href: '#modules',
steps: [
{
title: 'Create your project',
body: () => (
<p>
Start by creating a new Nuxt.js project if you don’t have one set up already. The most
Start by creating a new Nuxt project if you don’t have one set up already. The most
common approach is to use the{' '}
<a href="https://nuxt.com/docs/getting-started/installation">
Nuxt Command Line Interface
Expand All @@ -178,101 +183,14 @@ let tabs = [
title: 'Install Tailwind CSS',
body: () => (
<p>
Install <code>tailwindcss</code> and its peer dependencies via npm, and then run the
init command to generate a <code>tailwind.config.js</code> file.
Using nuxi, install the <code>@nuxtjs/tailwindcss</code> module and then run the init
command to generate a <code>tailwind.config.js</code> file.
</p>
),
code: {
name: 'Terminal',
lang: 'terminal',
code: 'npm install -D tailwindcss postcss autoprefixer\nnpx tailwindcss init',
},
},
{
title: 'Add Tailwind to your PostCSS configuration',
body: () => (
<p>
Add <code>tailwindcss</code> and <code>autoprefixer</code> to the{' '}
<code>postcss.plugins</code> object in your <code>nuxt.config.js</code> file.
</p>
),
code: {
name: 'nuxt.config.js',
lang: 'js',
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
> postcss: {
> plugins: {
> tailwindcss: {},
> autoprefixer: {},
> },
> },
})`,
},
},
{
title: 'Configure your template paths',
body: () => (
<p>
Add the paths to all of your template files in your <code>tailwind.config.js</code>{' '}
file.
</p>
),
code: {
name: 'tailwind.config.js',
lang: 'js',
code: ` /** @type {import('tailwindcss').Config} */
module.exports = {
> content: [
> "./components/**/*.{js,vue,ts}",
> "./layouts/**/*.vue",
> "./pages/**/*.vue",
> "./plugins/**/*.{js,ts}",
> "./nuxt.config.{js,ts}",
> "./app.vue",
> ],
theme: {
extend: {},
},
plugins: [],
}`,
},
},
{
title: 'Add the Tailwind directives to your CSS',
body: () => (
<p>
Create an <code>./assets/css/main.css</code> file and add the <code>@tailwind</code>{' '}
directives for each of Tailwind’s layers.
</p>
),
code: {
name: 'main.css',
lang: 'css',
code: '@tailwind base;\n@tailwind components;\n@tailwind utilities;',
},
},
{
title: 'Add the CSS file globally',
body: () => (
<p>
Add your newly-created <code>./assets/css/main.css</code> to the <code>css</code> array
in your <code>nuxt.config.js</code> file.
</p>
),
code: {
name: 'nuxt.config.js',
lang: 'js',
code: ` // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
> css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
})`,
code: 'npm install\nnpx nuxi module add @nuxtjs/tailwindcss\nnpx tailwindcss init',
},
},
{
Expand Down Expand Up @@ -316,8 +234,8 @@ export default function UsingNuxtJs({ code }) {

return (
<FrameworkGuideLayout
title="Install Tailwind CSS with Nuxt.js"
description="Setting up Tailwind CSS in a Nuxt.js project."
title="Install Tailwind CSS with Nuxt"
description="Setting up Tailwind CSS in a Nuxt project."
>
<TabBar tabs={tabs} selectedTabIndex={selectedTabIndex} />
<Steps steps={tabs[selectedTabIndex].steps} code={code[selectedTabIndex]} />
Expand All @@ -337,8 +255,8 @@ export function getStaticProps() {

UsingNuxtJs.layoutProps = {
meta: {
title: 'Install Tailwind CSS with Nuxt.js',
description: 'Setting up Tailwind CSS in a Nuxt.js project.',
title: 'Install Tailwind CSS with Nuxt',
description: 'Setting up Tailwind CSS in a Nuxt project.',
section: 'Installation',
},
Layout: DocumentationLayout,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/installation/framework-guides.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function FrameworkGuides() {
logo: ViteLogo,
},
{
name: 'Nuxt.js',
name: 'Nuxt',
slug: 'nuxtjs',
description: 'Intuitive Vue framework for building universal applications.',
logo: NuxtJsLogo,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/showcase/keepgrading/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ export const meta = {
ogImage: require('./og.jpg'),
image: require('./1.png'),
imageAlt: 'Screenshot from the animated introduction to the KeepGrading website.',
tech: 'Tailwind CSS, Nuxt.js, Vue',
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.',
tech: 'Tailwind CSS, Nuxt, Vue',
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.',
}

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

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.
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.

</Intro>

Expand Down