Miss any of our Open RFC calls?Watch the recordings here! »

generate-atomic-css

1.2.53 • Public • Published

generate-atomic-css

Generate Atomic CSS

Install

npm i generate-atomic-css

Quick Take

import { strict as assert } from "assert";
import {
  genAtomic,
  version,
  headsAndTails,
  extractFromToSource,
} 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 and examples.

Licence

MIT License

Copyright (c) 2010-2020 Roy Revelt and other contributors

ok codsen star

Install

npm i generate-atomic-css

DownloadsWeekly Downloads

24

Version

1.2.53

License

MIT

Unpacked Size

174 kB

Total Files

10

Last publish

Collaborators

  • avatar