-
Notifications
You must be signed in to change notification settings - Fork 13.5k
/
card-title.tsx
42 lines (39 loc) · 1.16 KB
/
card-title.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import type { ComponentInterface } from '@stencil/core';
import { Component, Host, Prop, h } from '@stencil/core';
import { createColorClasses } from '@utils/theme';
import { getIonMode } from '../../global/ionic-global';
import type { Color } from '../../interface';
/**
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
*/
@Component({
tag: 'ion-card-title',
styleUrls: {
ios: 'card-title.ios.scss',
md: 'card-title.md.scss',
},
shadow: true,
})
export class CardTitle implements ComponentInterface {
/**
* The color to use from your application's color palette.
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
* For more information on colors, see [theming](/docs/theming/basics).
*/
@Prop({ reflect: true }) color?: Color;
render() {
const mode = getIonMode(this);
return (
<Host
role="heading"
aria-level="2"
class={createColorClasses(this.color, {
'ion-inherit-color': true,
[mode]: true,
})}
>
<slot></slot>
</Host>
);
}
}