0.0.1 • Published 4 years ago
@hkau/simplecss v0.0.1
SimpleCSS 🍊
A fast, simple, and powerful CSS compiler to generate CSS from very simple, single line CSS rules.
Usage
After installing the package, you can just use node.js to compile CSS.
node simplecss.js -i <input_file> -o <output_file>To display the help page, use node simplecss.js -h.
Syntax
The syntax is very simple. Just write normal CSS rules in the input file, and then compile.
div.h1 -> color: blackRules can be separated by commas.
div#h1 -> color: black, font-size: 20pxYou can also define "substitutions" for the property names.
@sub clr -> color
div.h1 -> clr: black
div.h2 -> clr: red/* (compiled) */
div.h1 {
color: black;
}
div.h2 {
color: red;
}By using the @includesub directive, you can include a file with substitutions.
@includesub ./substitutions.css
div.h1 -> custom-sub: 0The default substitution file can be imported with the @includesub directive with the name properties.
@includesub properties
div.h1 -> ml: 20px, mr: 20pxIt includes substitutions based on abbreviated versions of the default properties names, so something like margin-left will be replaced with ml.
0.0.1
4 years ago