Refactor make.unit.unit

This commit is contained in:
pyoor 2017-04-25 11:24:56 -04:00
parent 2e65a4bea3
commit ac7ac78d92
2 changed files with 4 additions and 4 deletions

View file

@ -29,9 +29,9 @@ make.font = {
/* <relative-size> values */ /* <relative-size> values */
["larger", "smaller"], ["larger", "smaller"],
/* <length> values */ /* <length> values */
make.number.unsignedNumber() + make.units.units(), make.number.unsignedNumber() + make.unit.unit(),
/* <percentage> values */ /* <percentage> values */
make.units.percent(), make.unit.percent(),
]); ]);
}, },
genericFamily: function () { genericFamily: function () {

View file

@ -3,13 +3,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
make.unit = { make.unit = {
units: function () { unit: function () {
return random.pick([ return random.pick([
"px", "em", "ex", "ch", "rem", "mm", "cm", "in", "pt", "pc", "%" "px", "em", "ex", "ch", "rem", "mm", "cm", "in", "pt", "pc", "%"
]); ]);
}, },
length: function () { length: function () {
return make.number.any() + make.unit.units(); return make.number.any() + make.unit.unit();
}, },
percent: function () { percent: function () {
return make.number.any() + "%"; return make.number.any() + "%";