@garfish/css-scope
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'],
}),
],
})