flexGrow.js 543 B

12345678910111213141516171819
  1. 'use strict';
  2. var parseNumber = require('../parsers').parseNumber;
  3. var POSITION_AT_SHORTHAND = require('../constants').POSITION_AT_SHORTHAND;
  4. module.exports.isValid = function isValid(v, positionAtFlexShorthand) {
  5. return parseNumber(v) !== undefined && positionAtFlexShorthand === POSITION_AT_SHORTHAND.first;
  6. };
  7. module.exports.definition = {
  8. set: function(v) {
  9. this._setProperty('flex-grow', parseNumber(v));
  10. },
  11. get: function() {
  12. return this.getPropertyValue('flex-grow');
  13. },
  14. enumerable: true,
  15. configurable: true,
  16. };