Add units.js
This commit is contained in:
parent
5d7b77016c
commit
240c062a9a
1 changed files with 13 additions and 0 deletions
13
make/units.js
Normal file
13
make/units.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
make.units = {
|
||||||
|
lengthUnit: function () {
|
||||||
|
return random.pick([
|
||||||
|
"px", "em", "ex", "ch", "rem", "mm", "cm", "in", "pt", "pc", "%"
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
length: function () {
|
||||||
|
return make.number() + make.lengthUnit();
|
||||||
|
},
|
||||||
|
percent: function () {
|
||||||
|
return make.number() + "%";
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in a new issue