support ms and s unit
This commit is contained in:
parent
7d75cb1e09
commit
6c305e1523
|
|
@ -114,7 +114,7 @@ function add_unit(fn, unit) {
|
|||
|
||||
function get_unit(str) {
|
||||
if (!str) return '';
|
||||
let unit = /(%|cm|em|ex|in|mm|pc|pt|px|vh|vw|vmin|deg)$/;
|
||||
let unit = /(%|cm|em|ex|in|mm|pc|pt|px|vh|vw|vmin|deg|ms|s)$/;
|
||||
let matched = ''.trim.call(str).match(unit);
|
||||
return matched ? matched[0] : '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ function add_unit(fn, unit) {
|
|||
|
||||
function get_unit(str) {
|
||||
if (!str) return '';
|
||||
let unit = /(%|cm|em|ex|in|mm|pc|pt|px|vh|vw|vmin|deg)$/;
|
||||
let unit = /(%|cm|em|ex|in|mm|pc|pt|px|vh|vw|vmin|deg|ms|s)$/;
|
||||
let matched = ''.trim.call(str).match(unit);
|
||||
return matched ? matched[0] : '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue