1.0.0 • Published 4 years ago

utils.scss v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

untils.scss

some utils of scss

Tool method, generaly not used directly.

  • @function strip-unit
/* 
  remove units
  @params { (Number|String[]) } $value - the value to remove units
*/
body{
  font-size: strip-units(12px); // font-size: 12;
}
  • @function pow
/* 
  usage similar to Math.pow width scss
  @params { Number } $x - the pow base value
  @params { Number } $n - the pow times value
*/
body{
  font-size: pow(10, 2); // 100
}
  • @function toFixedN
/* 
  toFixedN usage similar to Number.toFixed width scss
  @param { (Number|String[]) } $value - the value to be fixed, can with units
  @param { Number= } [$digital=3] - the fixed decimal
*/
body{
  font-size: toFixedN(12.1234, 3); // 12.123
}