0.0.10 • Published 2 years ago

@tinyfe/parse-unit v0.0.10

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

parse unit

parses number and unit, eg: '100px' into 100, 'px', also it include validate css value

Usage

import parseUnit, { isCssValue } from '@tinyfe/parse-unit';

// judge the css value
isCssValue('100px'); // true

// parse unit by the value
parseUnit('100px'); // [100, 'px']
parseUnit('100%'); // [100, '%']
parseUnit('100'); // [100, '']

// CSS unit
parseUnit('auto'); // ['auto', '']
parseUnit('revert'); // ['revert', '']
parseUnit('unset'); // ['unset', '']
parseUnit('inherit'); // ['inherit', '']
parseUnit('initial'); // ['initial', '']
parseUnit('max-content'); // ['max-content', '']
parseUnit('min-content'); // ['min-content', '']
parseUnit('fit-content'); // ['fit-content', '']
parseUnit('-webkit-fill-available'); // ['-webkit-fill-available', '']
// etc...
0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago