PostCSS plugin to scale (up/down) CSS numerical values.
.foo {
height:100px;
}Reduced by 50%:
.foo {
height:50px;
}npm i @modnxyz/scalablecss
- The package is available on both NPM and Github registry.
ScalableCSS takes one argument, which is javascript object:
options={// required options percent: (1/2)*100,// scaling percent, e.g. 50%// optional optionsdeclares:['min-height','height']// an array of declares, the scaling will apply **only** to it.// the default value: // ['min-height','min-width','left','top','width','height','margin', 'padding', 'font-size', 'line-height', 'transform'];}// Then embed it into your project.scalableCSS(options)See PostCSS docs for examples related to your environment.
- Refactoring.
- Implement
cliversion. - Scale
functionsnumerical values, e.g. scale downtranslate(100px)totranslate(50px).
Feel free to pick one, and submit pull request!
- Author: Fares AlHarbi, ≡ Mod(N).
- License: MIT license, 2021 ≡ Mod(N), all rights reserved.