lineHeight.js 613 B

123456789101112131415161718192021
  1. 'use strict';
  2. var TYPES = require('../parsers').TYPES;
  3. var valueType = require('../parsers').valueType;
  4. module.exports.isValid = function isValid(v) {
  5. var type = valueType(v);
  6. return (type === TYPES.KEYWORD && (v.toLowerCase() === 'normal') || (v.toLowerCase() === 'inherit')) ||
  7. type === TYPES.NUMBER || type === TYPES.LENGTH || type === TYPES.PERCENT;
  8. };
  9. module.exports.definition = {
  10. set: function (v) {
  11. this._setProperty('line-height', v);
  12. },
  13. get: function () {
  14. return this.getPropertyValue('line-height');
  15. },
  16. enumerable: true,
  17. configurable: true
  18. };