@atomic2103/chaicode-css
v0.1.0
Published
A tiny utility-first CSS runtime that turns chai-* classes into generated CSS in the browser.
Maintainers
Readme
ChaiCSS
ChaiCSS is a tiny utility-first CSS runtime that scans chai-* classes in the browser and generates matching CSS rules on the fly.
Install
npm install @atomic2103/chaicode-cssUsage
ESM
import ChaiCSS from "@atomic2103/chaicode-css";
ChaiCSS.refresh();CommonJS
const ChaiCSS = require("@atomic2103/chaicode-css");
ChaiCSS.refresh();Browser script tag
<script src="https://unpkg.com/@atomic2103/chaicode-css/dist/chai-css.js"></script>
<script>
ChaiCSS.refresh();
</script>API
ChaiCSS.refresh(root?): scans the document or a subtree forchai-*classes and injects runtime CSS.ChaiCSS.theme: exposes the current color, type, spacing-related tokens, shadows, and radii.ChaiCSS.referenceGroups: lightweight grouped examples used by the demo site.ChaiCSS.getCssText(): returns the generated CSS text currently held by the runtime.
Included Files
The published package only ships the runtime bundle and package docs.
"files": ["dist", "README.md"]That means the landing page demo files in this repo are kept out of the npm tarball.
Publish Checklist
- Make sure your npm token has package write access, or publish with
npm loginplus OTP. - Fill in any final metadata you want, such as author, repository, homepage, and your preferred license.
- If you want the package to be open source, replace
UNLICENSEDwith your actual license and add aLICENSEfile. - Run
npm run check. - Run
npm run pack:dry. - Publish with
npm run publish:public.
Local Demo
This repo still includes a showcase landing page. Open index.html locally to test the runtime and playground in the browser.
