background-clip.js 1.2 KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var IPropertyDescriptor_1 = require("../IPropertyDescriptor");
  4. var parser_1 = require("../syntax/parser");
  5. var BACKGROUND_CLIP;
  6. (function (BACKGROUND_CLIP) {
  7. BACKGROUND_CLIP[BACKGROUND_CLIP["BORDER_BOX"] = 0] = "BORDER_BOX";
  8. BACKGROUND_CLIP[BACKGROUND_CLIP["PADDING_BOX"] = 1] = "PADDING_BOX";
  9. BACKGROUND_CLIP[BACKGROUND_CLIP["CONTENT_BOX"] = 2] = "CONTENT_BOX";
  10. })(BACKGROUND_CLIP = exports.BACKGROUND_CLIP || (exports.BACKGROUND_CLIP = {}));
  11. exports.backgroundClip = {
  12. name: 'background-clip',
  13. initialValue: 'border-box',
  14. prefix: false,
  15. type: IPropertyDescriptor_1.PropertyDescriptorParsingType.LIST,
  16. parse: function (tokens) {
  17. return tokens.map(function (token) {
  18. if (parser_1.isIdentToken(token)) {
  19. switch (token.value) {
  20. case 'padding-box':
  21. return BACKGROUND_CLIP.PADDING_BOX;
  22. case 'content-box':
  23. return BACKGROUND_CLIP.CONTENT_BOX;
  24. }
  25. }
  26. return BACKGROUND_CLIP.BORDER_BOX;
  27. });
  28. }
  29. };
  30. //# sourceMappingURL=background-clip.js.map