# csskit

> Refreshing CSS

Latest version **0.0.41** (published 2026-11-17) · MIT license · 0 weekly downloads

## Install

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

Provides the command `csskit`.

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.41 |
| Published | 2026-11-17 |
| First published | 2015-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 328 |
| Author | Keith Cirkel |
| Maintainers | keithamus |

## Links

- npm: https://www.npmjs.com/package/csskit
- Repository: https://github.com/csskit/csskit
- Homepage: https://github.com/csskit/csskit#readme
- Issues: https://github.com/csskit/csskit/issues
- Funding: https://github.com/sponsors/keithamus
- npm.io page: https://npm.io/package/csskit

## Recent versions

- 0.0.41 (latest) — 2026-11-17
- 0.0.42-canary.202611210314 (canary) — 2026-11-21
- 0.0.42-canary.202611200315 — 2026-11-20
- 0.0.42-canary.202611190928 — 2026-11-19
- 0.0.42-canary.202611181233 — 2026-11-18
- 0.0.42-canary.d92b0cecac — 2026-11-18
- 0.0.42-canary.62c143ae1c — 2026-11-18
- 0.0.42-canary.50bdb0c356 — 2026-11-18
- 0.0.41-canary.1011f99394 — 2026-11-17
- 0.0.41-canary.6b97b1ff18 — 2026-11-17
- 0.0.40-canary.32a9c928e4 — 2026-11-17
- 0.0.40-canary.202cc871cb — 2026-11-17
- 0.0.40 — 2026-11-17
- 0.0.40-canary.3c8a4e565a — 2026-11-17
- 0.0.40-canary.63b871968f — 2026-11-17
- … 723 more at https://npm.io/package/csskit/versions

## README

# csskit

csskit is a suite of high performance tools for CSS, written in Rust.

## Goals

The goal of this project is to provide a high quality set of tools for writing
native CSS and shipping said CSS into production the best way possible.
This means:

- Preventing mistakes at author time (parsing & linting).
- Advising best practices and highlighting pitfalls (linting).
- Allow consistent homogeneous code to be written (formatting).
- Allowing the authorship of modern CSS that is downsampled for browser support ("transpiling").
- Provides integration with IDEs (LSP).
- Producing the smallest available artefacts (minification & bundling).
- Provide a way for authors to migrate from alternative authoring formats (such as SCSS).

## Usage

### Binary

When installed, `csskit` will be available as a binary. Run `csskit --help` to
see how to use it, with full instructions and examples.

### Library

csskit can also be used as a library, for creating custom scripts:

```js
import { parse, StyleRule, StyleSheet } from "csskit";

const sheet = parse("a { color: red }");
sheet instanceof StyleSheet; // true

for (const rule of sheet.querySelectorAll("style-rule")) {
 console.log(rule.constructor.name, rule.text); // StyleRule a { color: red }
}
```

Every AST node kind has its own class, similar to way the DOM has
`HTMLDivElement`. Each one has a `parse` method. This allows you to parse
individual grammars, for example:

```js
import { parse, Color, MediaRule, WidthStyleValue } from "csskit/nodes";

Color.parse("#ff0000");
WidthStyleValue.parse("100px");
parse("@media print { a { color: red } }", { context: MediaRule });
```

`minify` minifies a stylesheet, and throws on a parse error:

```js
import { minify } from "csskit";

minify("a { color: #ff0000 }"); // a{color:red}
```

#### Client Side

While the main entry is a native addon, therefore only possible to use in Node,
a simplified WASM API is available for client side code:

```js
import { minify } from "csskit/bundle";
const min = minify("a{color:#ff0000}");
console.assert(min === "a{color:red}");
```

The WASM build exposes `lex`, `minify`, `format` and `parseErrorReport`, but no
object model, so classes like `Color` are not available.

Visit the [Getting started guide](https://csskit.rs/docs/getting-started/) for more detail.

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