Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

53 строки
1.8 KiB

  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6. var _toCss = require('../utils/toCss');
  7. var _toCss2 = _interopRequireDefault(_toCss);
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  9. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10. var FontFaceRule = function () {
  11. function FontFaceRule(key, style, options) {
  12. _classCallCheck(this, FontFaceRule);
  13. this.type = 'font-face';
  14. this.isProcessed = false;
  15. this.key = key;
  16. this.style = style;
  17. this.options = options;
  18. }
  19. /**
  20. * Generates a CSS string.
  21. */
  22. _createClass(FontFaceRule, [{
  23. key: 'toString',
  24. value: function toString(options) {
  25. if (Array.isArray(this.style)) {
  26. var str = '';
  27. for (var index = 0; index < this.style.length; index++) {
  28. str += (0, _toCss2['default'])(this.key, this.style[index]);
  29. if (this.style[index + 1]) str += '\n';
  30. }
  31. return str;
  32. }
  33. return (0, _toCss2['default'])(this.key, this.style, options);
  34. }
  35. }]);
  36. return FontFaceRule;
  37. }();
  38. exports['default'] = FontFaceRule;