font-family.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.fontFamily = void 0;
  4. exports.fontFamily = {
  5. name: "font-family",
  6. initialValue: '',
  7. prefix: false,
  8. type: 1 /* LIST */,
  9. parse: function (_context, tokens) {
  10. var accumulator = [];
  11. var results = [];
  12. tokens.forEach(function (token) {
  13. switch (token.type) {
  14. case 20 /* IDENT_TOKEN */:
  15. case 0 /* STRING_TOKEN */:
  16. accumulator.push(token.value);
  17. break;
  18. case 17 /* NUMBER_TOKEN */:
  19. accumulator.push(token.number.toString());
  20. break;
  21. case 4 /* COMMA_TOKEN */:
  22. results.push(accumulator.join(' '));
  23. accumulator.length = 0;
  24. break;
  25. }
  26. });
  27. if (accumulator.length) {
  28. results.push(accumulator.join(' '));
  29. }
  30. return results.map(function (result) { return (result.indexOf(' ') === -1 ? result : "'" + result + "'"); });
  31. }
  32. };
  33. //# sourceMappingURL=font-family.js.map