UNPKG

@sequencemedia/css-purge

Version:

A CSS tool written in Node JS as a command line app or library for the purging, burning, reducing, shortening, compressing, cleaning, trimming and formatting of duplicate, extra, excess or bloated CSS.

12 lines (9 loc) 259 B
export default function componentFromString (string, max) { let component = 0 if (/%$/g.test(string)) { // is percentage component = Math.floor(max * (parseFloat(string) / 100.0)) } else { component = parseInt(string) } return component }