utils.scss

Scss tool method, generaly not use directly

Usage no npm install needed!

<script type="module">
  import utilsScss from 'https://cdn.skypack.dev/utils.scss';
</script>

README

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
}