background-image.js 912 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tokenizer_1 = require("../syntax/tokenizer");
  4. var image_1 = require("../types/image");
  5. var IPropertyDescriptor_1 = require("../IPropertyDescriptor");
  6. var parser_1 = require("../syntax/parser");
  7. exports.backgroundImage = {
  8. name: 'background-image',
  9. initialValue: 'none',
  10. type: IPropertyDescriptor_1.PropertyDescriptorParsingType.LIST,
  11. prefix: false,
  12. parse: function (tokens) {
  13. if (tokens.length === 0) {
  14. return [];
  15. }
  16. var first = tokens[0];
  17. if (first.type === tokenizer_1.TokenType.IDENT_TOKEN && first.value === 'none') {
  18. return [];
  19. }
  20. return tokens.filter(function (value) { return parser_1.nonFunctionArgSeparator(value) && image_1.isSupportedImage(value); }).map(image_1.image.parse);
  21. }
  22. };
  23. //# sourceMappingURL=background-image.js.map