npm.io
1.19.12 • Published 3 months ago

@garfish/css-scope

Licence
MIT
Version
1.19.12
Deps
2
Size
51 kB
Vulns
0
Weekly
0
Stars
2.9K

@garfish/css-scope

NPM version

Inspired by reworkcss/css.

TJ is my idol.

Usage

Need webAssembly support

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

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

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

Keywords