mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
* chore(): update ionicons * refactor(all): updating to newest stencil apis * fix lint issues * more changes * moreee * fix treeshaking * fix config * fix checkbox * fix stuff * chore(): update ionicons * fix linting errors
39 lines
930 B
TypeScript
39 lines
930 B
TypeScript
import { Component, ComponentInterface, Prop } from '@stencil/core';
|
|
|
|
import { getIonMode } from '../../global/ionic-global';
|
|
|
|
/**
|
|
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
|
*/
|
|
@Component({
|
|
tag: 'ion-header',
|
|
styleUrls: {
|
|
ios: 'header.ios.scss',
|
|
md: 'header.md.scss'
|
|
}
|
|
})
|
|
export class Header implements ComponentInterface {
|
|
|
|
/**
|
|
* If `true`, the header will be translucent. Only applies to `ios` mode.
|
|
* Note: In order to scroll content behind the header, the `fullscreen`
|
|
* attribute needs to be set on the content.
|
|
*/
|
|
@Prop() translucent = false;
|
|
|
|
hostData() {
|
|
const mode = getIonMode(this);
|
|
return {
|
|
class: {
|
|
[mode]: true,
|
|
|
|
// Used internally for styling
|
|
[`header-${mode}`]: true,
|
|
|
|
[`header-translucent`]: this.translucent,
|
|
[`header-translucent-${mode}`]: this.translucent,
|
|
}
|
|
};
|
|
}
|
|
}
|