Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
/ pieces-js Public archive

(WIP)A library that transforms your regular CSS into Atomic CSS in compile time.

License

Notifications You must be signed in to change notification settings

hyf0/pieces-js

Repository files navigation

Using tailwindcss or windicss instead

pieces-js(WIP)

A library that transforms your regular CSS into Atomic CSS in compile time. Heavily inspired by stylex and linaria.

Online Example with Vite

Features

  • Transform your regular CSS into Atomic CSS by compiler
  • Easy to use with familiar CSS syntax
  • Zero runtime for a CSS-in-JS library
  • Compiling on demand in development
  • No xxx.config.js 😉

Documentation

Installation

npm install @pieces-js/tag
npm install -D @pieces-js/plugin
// or
yarn add @pieces-js/tag
yarn add -D @pieces-js/plugin

Overview

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;
}

About

(WIP)A library that transforms your regular CSS into Atomic CSS in compile time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published