# @garfish/css-scope

> css scope

Latest version **1.19.12** (published 2026-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @garfish/css-scope
pnpm add @garfish/css-scope
yarn add @garfish/css-scope
bun add @garfish/css-scope
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.19.12 |
| Published | 2026-08-04 |
| First published | 2022-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 51 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2929 |
| Author | chentao.arthur <chentao.arthur@bytedance.com> |
| Maintainers | reothues, aishiguang, cttrevor, shawzhou, jiadi0801, imtaotao, jsongo, zengkp |
| Keywords | garfish, css scope |

## Links

- npm: https://www.npmjs.com/package/@garfish/css-scope
- Repository: https://github.com/bytedance/garfish
- Issues: https://github.com/bytedance/garfish/issues
- npm.io page: https://npm.io/package/@garfish/css-scope

## Dependencies (2)

- [@garfish/utils](https://npm.io/package/@garfish/utils.md) 1.19.12
- [super-fast-md5](https://npm.io/package/super-fast-md5.md) 0.0.7

## Recent versions

- 1.19.12 (latest) — 2026-08-04
- 1.19.7-beta-20250911075322.0 (beta) — 2025-09-11
- 1.19.8 — 2026-01-04
- 1.19.7 — 2025-09-11
- 1.19.6 — 2025-08-27
- 1.19.6-beta-20250826044806.0 — 2025-08-26
- 1.19.5 — 2025-07-24
- 1.19.5-beta-20250721072428.0 — 2025-07-21
- 1.19.5-beta-20250710084602.0 — 2025-07-10
- 1.19.4 — 2025-02-17
- 1.19.4-beta-20241223053444.0 — 2024-12-23
- 1.19.4-beta-20241223052420.0 — 2024-12-23
- 1.19.3 — 2024-10-31
- 1.19.2 — 2024-07-16
- 1.19.2-beta-20240715085255.0 — 2024-07-15
- … 112 more at https://npm.io/package/@garfish/css-scope/versions

## README

# `@garfish/css-scope`

[![NPM version](https://img.shields.io/npm/v/@garfish/css-scope.svg?style=flat-square)](https://www.npmjs.com/package/@garfish/css-scope)

Inspired by [reworkcss/css](https://github.com/reworkcss/css).

> [TJ](https://github.com/tj) is my idol.

## Usage

> Need webAssembly support

```js
import { parse, stringify } from '@garfish/css-scope';

const code = 'a { color: #fff; }';
const ast = parse(code);
const scopedCode = stringify(ast, 'App'); // #App a { color: #fff; }
```

## Use in Garfish

```js
import { GarfishCssScope } from '@garfish/css-scope';

Garfish.run({
  ...
  plugins: [
    GarfishCssScope({
      fixBodyGetter: true,
      excludes: ['appName'],
    }),
  ],
})
```

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