Skip to content

Commit

Permalink
docs: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed Mar 13, 2023
1 parent 45ef77c commit 7c4561f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
31 changes: 14 additions & 17 deletions docs/content/1.getting-started/1.setup.md
Expand Up @@ -2,20 +2,22 @@

Using Tailwind CSS in your Nuxt project is only one command away ✨

---

## Installation

1. Add `@nuxtjs/tailwindcss` dependency to your project:
1. Install `@nuxtjs/tailwindcss` dependency to your project:

::code-group

```bash [Yarn]
yarn add --dev @nuxtjs/tailwindcss
```bash [yarn]
yarn add -D @nuxtjs/tailwindcss
```

```bash [npm]
npm install -D @nuxtjs/tailwindcss
```

```bash [NPM]
npm install --save-dev @nuxtjs/tailwindcss
```sh [pnpm]
pnpm i -D @nuxtjs/tailwindcss
```

::
Expand All @@ -25,27 +27,23 @@ npm install --save-dev @nuxtjs/tailwindcss
::code-group
```ts [nuxt.config (Nuxt 3)]
export default defineNuxtConfig({
modules: ['@nuxtjs/tailwindcss']
modules: ['@nuxtjs/tailwindcss']
})
```

```ts [nuxt.config (Nuxt 2)]
export default {
modules: ['@nuxtjs/tailwindcss']
buildModules: ['@nuxtjs/tailwindcss']
}
```
::

::alert{type="success"}

That's it! You can now use Tailwind classes in your Nuxt app ✨

::

::alert{type="info"}

Discover your color palette based on your Tailwind config with the [Tailwind viewer](/tailwind/viewer).

::

## Tailwind Files
Expand All @@ -58,12 +56,11 @@ When running `nuxt dev`, this module will look for these files:
If they don't exist, the module will inject a basic configuration for each one so you don't have to create these files.

::alert{type="info"}

You can configure the paths in the [module options](/getting-started/options).

::

If you're going to create your own Tailwind CSS file, make sure to add the `@tailwind` directives for each of Tailwind’s layers.

```css
@tailwind base;
@tailwind components;
Expand All @@ -77,11 +74,11 @@ Learn more about overwriting the Tailwind configuration in the [Tailwind Config]
You can customize the module's behavior by using the `tailwindcss` property in `nuxt.config`:

```ts [nuxt.config]
export default {
export default defineNuxtConfig({
tailwindcss: {
// Options
}
}
})
```

See the [module options](/getting-started/options).
9 changes: 4 additions & 5 deletions docs/content/1.getting-started/2.options.md
@@ -1,18 +1,17 @@
# Options

Configure Nuxt Tailwind easily with the `tailwindcss` property.
Configure Nuxt Tailwind with the `tailwindcss` property.

---

```ts [nuxt.config]
```ts [nuxt.config.ts]
export default {
// Defaults options
tailwindcss: {
cssPath: '~/assets/css/tailwind.css',
configPath: 'tailwind.config',
exposeConfig: false,
exposeLevel: 2,
config: {},
injectPosition: 0,
injectPosition: 'first',
viewer: true,
}
}
Expand Down

0 comments on commit 7c4561f

Please sign in to comment.