ion-text.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*!
  2. * (C) Ionic http://ionicframework.com - MIT License
  3. */
  4. import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
  5. import { c as createColorClasses } from './theme.js';
  6. import { b as getIonMode } from './ionic-global.js';
  7. const textCss = ":host(.ion-color){color:var(--ion-color-base)}";
  8. const IonTextStyle0 = textCss;
  9. const Text = /*@__PURE__*/ proxyCustomElement(class Text extends HTMLElement {
  10. constructor() {
  11. super();
  12. this.__registerHost();
  13. this.__attachShadow();
  14. this.color = undefined;
  15. }
  16. render() {
  17. const mode = getIonMode(this);
  18. return (h(Host, { key: '0c2546ea3f24b0a6bfd606199441d0a4edfa4ca1', class: createColorClasses(this.color, {
  19. [mode]: true,
  20. }) }, h("slot", { key: 'b7623ccb06f9461090a1f33e9f85886c7a4d5eff' })));
  21. }
  22. static get style() { return IonTextStyle0; }
  23. }, [1, "ion-text", {
  24. "color": [513]
  25. }]);
  26. function defineCustomElement$1() {
  27. if (typeof customElements === "undefined") {
  28. return;
  29. }
  30. const components = ["ion-text"];
  31. components.forEach(tagName => { switch (tagName) {
  32. case "ion-text":
  33. if (!customElements.get(tagName)) {
  34. customElements.define(tagName, Text);
  35. }
  36. break;
  37. } });
  38. }
  39. const IonText = Text;
  40. const defineCustomElement = defineCustomElement$1;
  41. export { IonText, defineCustomElement };