backgroundAttachment.js 568 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. var parsers = require('../parsers');
  3. var isValid = (module.exports.isValid = function isValid(v) {
  4. return (
  5. parsers.valueType(v) === parsers.TYPES.KEYWORD &&
  6. (v.toLowerCase() === 'scroll' || v.toLowerCase() === 'fixed' || v.toLowerCase() === 'inherit')
  7. );
  8. });
  9. module.exports.definition = {
  10. set: function(v) {
  11. if (!isValid(v)) {
  12. return;
  13. }
  14. this._setProperty('background-attachment', v);
  15. },
  16. get: function() {
  17. return this.getPropertyValue('background-attachment');
  18. },
  19. enumerable: true,
  20. configurable: true,
  21. };