@ionic/core
Version:
Base components for Ionic
48 lines (47 loc) • 1.49 kB
JavaScript
import { Component, Host, Prop, h } from '@stencil/core';
import { getIonMode } from '../../global/ionic-global';
import { createColorClasses } from '../../utils/theme';
/**
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
*/
export class Text {
render() {
const mode = getIonMode(this);
return (h(Host, { class: createColorClasses(this.color, {
[mode]: true,
}) },
h("slot", null)));
}
static get is() { return "ion-text"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() { return {
"$": ["text.scss"]
}; }
static get styleUrls() { return {
"$": ["text.css"]
}; }
static get properties() { return {
"color": {
"type": "string",
"mutable": false,
"complexType": {
"original": "Color",
"resolved": "string | undefined",
"references": {
"Color": {
"location": "import",
"path": "../../interface"
}
}
},
"required": false,
"optional": true,
"docs": {
"tags": [],
"text": "The color to use from your application's color palette.\nDefault options are: `\"primary\"`, `\"secondary\"`, `\"tertiary\"`, `\"success\"`, `\"warning\"`, `\"danger\"`, `\"light\"`, `\"medium\"`, and `\"dark\"`.\nFor more information on colors, see [theming](/docs/theming/basics)."
},
"attribute": "color",
"reflect": true
}
}; }
}