# @tailwindcss/nesting

> A light wrapper around any postcss nesting plugin improves compatibility with Tailwind CSS.

Latest version **0.0.0-insiders.565cd3e** (published 2021-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tailwindcss/nesting
pnpm add @tailwindcss/nesting
yarn add @tailwindcss/nesting
bun add @tailwindcss/nesting
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0-insiders.565cd3e |
| Published | 2021-10-05 |
| First published | 2021-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | reinink, adamwathan, bradlc, malfaitrobin |

## Links

- npm: https://www.npmjs.com/package/@tailwindcss/nesting
- npm.io page: https://npm.io/package/@tailwindcss/nesting

## Dependencies (1)

- [postcss-nested](https://npm.io/package/postcss-nested.md) ^5.0.5

## Recent versions

- 0.0.0-insiders.565cd3e (latest) — 2021-10-05

## README

# @tailwindcss/nesting

This is a PostCSS plugin that wraps [postcss-nested](https://github.com/postcss/postcss-nested) or [postcss-nesting](https://github.com/jonathantneal/postcss-nesting) and acts as a compatibility layer to make sure your nesting plugin of choice properly understands custom syntax like `@apply` and `@screen`.

To use it, install it via npm:

```shell
npm install @tailwindcss/nesting
```

Then add it to your PostCSS configuration, somewhere before Tailwind itself:

```js
// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-import'),
    require('@tailwindcss/nesting'),
    require('tailwindcss'),
    require('autoprefixer'),
  ]
}
```

By default, it uses the [postcss-nested](https://github.com/postcss/postcss-nested) plugin under the hood, which uses a Sass-like syntax and is the plugin that powers nesting support in the [Tailwind CSS plugin API](https://tailwindcss.com/docs/plugins#css-in-js-syntax).

If you'd rather use [postcss-nesting](https://github.com/jonathantneal/postcss-nesting) (which is based on the work-in-progress [CSS Nesting](https://drafts.csswg.org/css-nesting-1/) specification), first install the plugin alongside `@tailwindcss/nesting`:

```shell
npm install @tailwindcss/nesting postcss-nesting
```

Then pass the plugin itself as an argument to `@tailwindcss/nesting` in your PostCSS configuration:

```js
// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-import'),
    require('@tailwindcss/nesting')(require('postcss-nesting')),
    require('tailwindcss'),
    require('autoprefixer'),
  ]
}
```

This can also be helpful if for whatever reason you need to use a very specific version of `postcss-nested` and want to override the version we bundle with `@tailwindcss/nesting` itself.

---
_Source: https://npm.io/package/@tailwindcss/nesting · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
