A command line wrapper for the excellent postcss-pxtorem module.
npm install --g pxtorem-cli
Pxtorem CLI takes 3 arguments:
Argument | Alias | Default | Description |
---|---|---|---|
--input |
-i |
n/a |
Relative path to the stylesheet to process |
--output |
-o |
n/a |
Relative path to save the processed stylesheet |
--rootvalue |
-r |
16 |
Default font size for conversion e.g 16px == 1rem |
cd you style folder
pxtorem -i style.css -o style.processed.css -r 16
if you give input arg, you have to give output arg
cd you style folder
pxtorem
it will process all style files in you style floder
warining it will use the default options, and it will use .processed as the filename suffix
{ "rootValue": 16, "unitPrecision": 5, "propWhiteList": [], "selectorBlackList": [], "replace": true, "mediaQuery": false, "minPixelValue": 0 }
but you can create a "pxtorem.json" file in the cwd folder to rewrite the options
check for css syntax errors
Add exception handling method
give a value to argument "r" in command line, it dose not work.