A library that transforms your regular CSS into Atomic CSS in compile time. Heavily inspired by stylex and linaria.
xxx.config.js
😉npm install @pieces-js/tag
npm install -D @pieces-js/plugin
// or
yarn add @pieces-js/tag
yarn add -D @pieces-js/plugin
import { css } from '@pieces-js/tag'
const className = css`
color: red;
font-size: 24px;
&:hover {
color: blue;
}
`
const className2 = css`
color: red;
font-size: 48px;
`
// --- will compile to ---
const className = 'c1 c2 c3'
const className2 = 'c1 c4'
with gennerated style
.c1 {
color: red;
}
.c2 {
font-size: 24px;
}
.c3:hover {
color: blue;
}
.c4 {
font-size: 48px;
}