0.1.2 • Published 3 years ago

@modn/scalablecss v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Scalable CSS

PostCSS plugin to scale (up/down) css numerical values.

Example

Input:

.foo {
    height: 100px;
}

Reduced by 50%:

Output:

.foo {
  height: 50px;
}

Installation

npm i @modn/scalablecss

Usage

ScalableCSS takes one argument, which is javascript object:

options = {
  // required options 
  percent: (1/2)*100,// scaling percent, e.g. 50%
  // optional options
  declares:['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.

TODO

  • Refactoring.
  • Implement cli version.
  • Scale functions numerical values, e.g. scale down translate(100px) to translate(50px).

Credit & License

  • Author: Fares AlHarbi, ≡ Mod(N).
  • License: MIT license, 2021 ≡ Mod(N), all rights reserved.
0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago