generate-atomic-css
v3.2.5
Published
Generate Atomic CSS
Downloads
1,124
Maintainers
Readme
No 3rd party dependencies. All dependencies, checked recursively, are Codsen packages.
Install
This package is pure ESM. If you're not ready yet, install an older version of this program, 1.5.0 (npm i [email protected]).
npm i generate-atomic-cssQuick Take
import { strict as assert } from "node:assert";
import {
extractFromToSource,
genAtomic,
headsAndTails,
version,
} from "generate-atomic-css";
assert.deepEqual(
genAtomic(
`a
/* GENERATE-ATOMIC-CSS-CONFIG-STARTS
.pb$$$ { padding-bottom: $$$px !important; } | 5 | 10
.mt$$$ { margin-top: $$$px !important; } | 1
GENERATE-ATOMIC-CSS-CONFIG-ENDS
GENERATE-ATOMIC-CSS-CONTENT-STARTS */
tralala
/* GENERATE-ATOMIC-CSS-CONTENT-ENDS */
z`,
{
includeConfig: false,
includeHeadsAndTails: false,
},
),
{
log: { count: 8 },
result: `a
.pb5 { padding-bottom: 5px !important; }
.pb6 { padding-bottom: 6px !important; }
.pb7 { padding-bottom: 7px !important; }
.pb8 { padding-bottom: 8px !important; }
.pb9 { padding-bottom: 9px !important; }
.pb10 { padding-bottom: 10px !important; }
.mt0 { margin-top: 0 !important; }
.mt1 { margin-top: 1px !important; }
z
`,
},
);Documentation
Please visit codsen.com for a full description of the API. For Changelog, see raw md on GitHub or the website.
Contributing
To report bugs or request features or assistance, raise an issue on GitHub.
Licence
MIT License
Copyright © 2010-2026 Roy Revelt and other contributors
