Skip to content

Commit

Permalink
Add tailwind integration new nesting option (withastro#5974)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: voxel!() <[email protected]>
  • Loading branch information
3 people authored Dec 29, 2023
1 parent 7ec48e3 commit 7d8a055
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/content/docs/en/guides/integrations-guide/tailwind.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,25 @@ export default defineConfig({

You can now [import your own `base.css` as a local stylesheet](/en/guides/styling/#import-a-local-stylesheet).

#### nesting

Set `true` to apply the [`tailwindcss/nesting` PostCSS plugin](https://tailwindcss.com/docs/using-with-preprocessors#nesting) so you can write nested CSS declarations alongside Tailwind's syntax. This option is `false` by default.

```js ins="nesting: true"
// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
integrations: [
tailwind({
// Example: Allow writing nested CSS declarations
// alongside Tailwind's syntax
nesting: true,
}),
],
});
```

## Examples

* The [Astro Tailwind Starter](https://github.com/withastro/astro/tree/latest/examples/with-tailwindcss?on=github) gets you up and running with a base for your project that uses Tailwind for styling
Expand Down

0 comments on commit 7d8a055

Please sign in to comment.