Files
2019-06-19 21:33:50 +02:00

41 lines
1.0 KiB
TypeScript

import { Component, ComponentInterface, Prop, h } from '@stencil/core';
import { getIonMode } from '../../global/ionic-global';
import { Color } from '../../interface';
import { createColorClasses } from '../../utils/theme';
/**
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
*/
@Component({
tag: 'ion-badge',
styleUrls: {
ios: 'badge.ios.scss',
md: 'badge.md.scss'
},
shadow: true
})
export class Badge 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() color?: Color;
hostData() {
const mode = getIonMode(this);
return {
class: {
...createColorClasses(this.color),
[`${mode}`]: true
}
};
}
render() {
return <slot></slot>;
}
}