UNPKG

3.13 kBJavaScriptView Raw
1/*!
2 * (C) Ionic http://ionicframework.com - MIT License
3 */
4import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
5import { b as getIonMode } from './ionic-global.js';
6import { c as createColorClasses } from './theme.js';
7
8const cardHeaderIosCss = ":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.card-header-translucent){background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);-webkit-backdrop-filter:saturate(180%) blur(30px);backdrop-filter:saturate(180%) blur(30px)}}";
9
10const cardHeaderMdCss = ":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-card-title:not(:first-child)),::slotted(ion-card-subtitle:not(:first-child)){margin-top:8px}";
11
12const CardHeader = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
13 constructor() {
14 super();
15 this.__registerHost();
16 this.__attachShadow();
17 /**
18 * If `true`, the card header will be translucent.
19 * Only applies when the mode is `"ios"` and the device supports
20 * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
21 */
22 this.translucent = false;
23 }
24 render() {
25 const mode = getIonMode(this);
26 return (h(Host, { class: createColorClasses(this.color, {
27 'card-header-translucent': this.translucent,
28 'ion-inherit-color': true,
29 [mode]: true
30 }) }, h("slot", null)));
31 }
32 static get style() { return {
33 ios: cardHeaderIosCss,
34 md: cardHeaderMdCss
35 }; }
36}, [33, "ion-card-header", {
37 "color": [513],
38 "translucent": [4]
39 }]);
40function defineCustomElement$1() {
41 if (typeof customElements === "undefined") {
42 return;
43 }
44 const components = ["ion-card-header"];
45 components.forEach(tagName => { switch (tagName) {
46 case "ion-card-header":
47 if (!customElements.get(tagName)) {
48 customElements.define(tagName, CardHeader);
49 }
50 break;
51 } });
52}
53
54const IonCardHeader = CardHeader;
55const defineCustomElement = defineCustomElement$1;
56
57export { IonCardHeader, defineCustomElement };