fix(all): accesibility and global styles for hidden nodes

This commit is contained in:
Manu Mtz.-Almeida
2018-07-22 12:02:51 +02:00
parent 0ed9406e8b
commit 4b844ef1c3
17 changed files with 75 additions and 42 deletions

View File

@ -0,0 +1,4 @@
:host(.menu-toggle-hidden) {
/* stylelint-disable-next-line declaration-no-important */
display: none;
}

View File

@ -2,6 +2,8 @@ import { Component, Listen, Prop, State } from '@stencil/core';
@Component({
tag: 'ion-menu-toggle',
styleUrl: 'menu-toggle.scss',
shadow: true
})
export class MenuToggle {
@Prop({ context: 'document' })
@ -54,9 +56,16 @@ export class MenuToggle {
hostData() {
const hidden = this.autoHide && !this.visible;
return {
'hidden': hidden
'aria-hidden': hidden ? 'true' : null,
class: {
'menu-toggle-hidden': hidden,
}
};
}
render() {
return <slot></slot>;
}
}
function getMenuController(doc: Document): Promise<HTMLIonMenuControllerElement|undefined> {