You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
577 B

  1. 'use strict';
  2. var parseMeasurement = require('../parsers').parseMeasurement;
  3. function parse(v) {
  4. if (String(v).toLowerCase() === 'auto') {
  5. return 'auto';
  6. }
  7. if (String(v).toLowerCase() === 'inherit') {
  8. return 'inherit';
  9. }
  10. return parseMeasurement(v);
  11. }
  12. module.exports.isValid = function isValid(v) {
  13. return parse(v) !== undefined;
  14. };
  15. module.exports.definition = {
  16. set: function(v) {
  17. this._setProperty('flex-basis', parse(v));
  18. },
  19. get: function() {
  20. return this.getPropertyValue('flex-basis');
  21. },
  22. enumerable: true,
  23. configurable: true,
  24. };