PostCSS plugin for use CSS more happy and more comfortable.
Getting Started
First thing's first, install the module:
yarn add postcss-ketchup --dev
or
npm install postcss-ketchup --save-dev
Usage
config
It's easy to get config.
when use postcss-cli:
var ketchup = digits: 2 designWidth: 375 ignoreDecl: 'font-size' ;var autoprefixer = ;;
when use webpack, more info to postcss-loader:
moduleexports = plugins: 'postcss-ketchup': {}
If you happen to use Vue-Cli3, you can edit css.loaderOptions.postcss in vue.config.js file for:
... postcss: plugins:
process
input
@);
px2vw's params will ignore declaration margin-top and padding prop when convert px to vw, and it will exactly keep five decimals, view more config to Config .(Do not forget semi-colon in the end)
output
Config
These are the available config options for config ketchup. Also visible in the at-rule params.
// the accuracy of floating-point arithmetic during unit conversion digits: 2 // the width of the UI design designWidth: 375 // the declaration should ignore during process css ignoreDecl: 'font-size' // the declaration must consider during process css forceDecl: