# unnestcss

> A library for un-nesting CSS

Latest version **1.2.1** (published 2025-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install unnestcss
pnpm add unnestcss
yarn add unnestcss
bun add unnestcss
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2025-09-02 |
| First published | 2024-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | startracex |
| Maintainers | startracex |

## Links

- npm: https://www.npmjs.com/package/unnestcss
- Repository: https://github.com/startracex/unnestcss
- Homepage: https://github.com/startracex/unnestcss#readme
- Issues: https://github.com/startracex/unnestcss/issues
- npm.io page: https://npm.io/package/unnestcss

## Recent versions

- 1.2.1 (latest) — 2025-09-02
- 1.2.0 — 2025-08-26
- 1.1.1 — 2025-08-25
- 1.1.0 — 2025-08-21
- 1.0.0 — 2025-08-20
- 0.0.8 — 2025-01-07
- 0.0.7 — 2024-08-28
- 0.0.6 — 2024-03-03
- 0.0.5 — 2024-03-02
- 0.0.3 — 2024-03-01
- 0.0.2 — 2024-02-29
- 0.0.1 — 2024-02-27
- 0.0.0 — 2024-02-25

## README

# unnestcss

A library for un-nesting CSS.

## Installation

```bash
npm install unnestcss
```

## Getting Started

```js
import { unnest } from "unnestcss";
```

```js
const { unnest } = require("unnestcss");
```

General nesting rules

```js
unnest(`
.root {
  --level: 1;
  .nest {
    --level: 2;
  }
}
`);
```

```css
.root {
  --level: 1;
}
.root .nest {
  --level: 2;
}
```

Nesting rules for `:host`

```js
unnest(`
:host {
  --level: 1;
  &:hover {
    --level: 2;
  }
}
`);
```

```css
:host {
  --level: 1;
}
:host(:hover) {
  --level: 2;
}
```

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