Add units.js

This commit is contained in:
Christoph Diehl 2017-04-12 22:18:23 +03:00
parent 5d7b77016c
commit 240c062a9a
1 changed files with 13 additions and 0 deletions

13
make/units.js Normal file
View 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() + "%";
},
};