background.js 811 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. var shorthandParser = require('../parsers').shorthandParser;
  3. var shorthandSetter = require('../parsers').shorthandSetter;
  4. var shorthandGetter = require('../parsers').shorthandGetter;
  5. var shorthand_for = {
  6. 'background-color': require('./backgroundColor'),
  7. 'background-image': require('./backgroundImage'),
  8. 'background-repeat': require('./backgroundRepeat'),
  9. 'background-attachment': require('./backgroundAttachment'),
  10. 'background-position': require('./backgroundPosition')
  11. };
  12. module.exports.isValid = function isValid(v) {
  13. return shorthandParser(v, shorthand_for) !== undefined;
  14. };
  15. module.exports.definition = {
  16. set: shorthandSetter('background', shorthand_for),
  17. get: shorthandGetter('background', shorthand_for),
  18. enumerable: true,
  19. configurable: true
  20. };