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

43 строки
1.2 KiB

  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const CSSRule_1 = __importDefault(require("../CSSRule"));
  7. const CSSStyleDeclaration_1 = __importDefault(require("../declaration/CSSStyleDeclaration"));
  8. /**
  9. * CSSRule interface.
  10. */
  11. class CSSStyleRule extends CSSRule_1.default {
  12. constructor() {
  13. super(...arguments);
  14. this.type = CSSRule_1.default.STYLE_RULE;
  15. this.selectorText = '';
  16. this.styleMap = new Map();
  17. this._cssText = '';
  18. this._style = null;
  19. }
  20. /**
  21. * Returns style.
  22. *
  23. * @returns Style.
  24. */
  25. get style() {
  26. if (!this._style) {
  27. this._style = new CSSStyleDeclaration_1.default();
  28. this._style.parentRule = this;
  29. this._style.cssText = this._cssText;
  30. }
  31. return this._style;
  32. }
  33. /**
  34. * Returns css text.
  35. *
  36. * @returns CSS text.
  37. */
  38. get cssText() {
  39. return `${this.selectorText} { ${this.style.cssText} }`;
  40. }
  41. }
  42. exports.default = CSSStyleRule;
  43. //# sourceMappingURL=CSSStyleRule.js.map