background-image.js 856 B

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