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

47 строки
1.4 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 CSSUnitValue_1 = __importDefault(require("./CSSUnitValue"));
  7. const CSSUnits_1 = __importDefault(require("./CSSUnits"));
  8. const css_escape_1 = __importDefault(require("css.escape"));
  9. /**
  10. * The CSS interface holds useful CSS-related methods.
  11. *
  12. * Reference:
  13. * https://developer.mozilla.org/en-US/docs/Web/API/CSS.
  14. */
  15. class CSS {
  16. /**
  17. * Constructor.
  18. */
  19. constructor() {
  20. for (const unit of CSSUnits_1.default) {
  21. this[unit] = (value) => new CSSUnitValue_1.default(value, unit);
  22. }
  23. }
  24. /**
  25. * Returns a Boolean indicating if the pair property-value, or the condition, given in parameter is supported.
  26. *
  27. * TODO: Always returns "true" for now, but it should probably be improved in the future.
  28. *
  29. * @param _condition Property name or condition.
  30. * @param [_value] Value when using property name.
  31. * @returns "true" if supported.
  32. */
  33. supports(_condition, _value) {
  34. return true;
  35. }
  36. /**
  37. * Escapes a value.
  38. *
  39. * @param value Value to escape.
  40. * @returns Escaped string.
  41. */
  42. escape(value) {
  43. return (0, css_escape_1.default)(value);
  44. }
  45. }
  46. exports.default = CSS;
  47. //# sourceMappingURL=CSS.js.map