@ionic/core
Version:
Base components for Ionic
131 lines (116 loc) • 2.59 kB
CSS
:host {
/**
* @prop --background: Background of the menu
*
* @prop --min-width: Minimum width of the menu
* @prop --width: Width of the menu
* @prop --max-width: Maximum width of the menu
*
* @prop --min-height: Minimum height of the menu
* @prop --height: Height of the menu
* @prop --max-height: Maximum height of the menu
*/
--width: 304px;
--min-width: auto;
--max-width: auto;
--height: 100%;
--min-height: auto;
--max-height: auto;
--background: var(--ion-background-color, #fff);
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
position: absolute;
contain: strict;
}
:host(.show-menu) {
display: block;
}
.menu-inner {
left: 0;
right: auto;
top: 0;
bottom: 0;
transform: translate3d(-9999px, 0, 0);
display: flex;
position: absolute;
flex-direction: column;
justify-content: space-between;
width: var(--width);
min-width: var(--min-width);
max-width: var(--max-width);
height: var(--height);
min-height: var(--min-height);
max-height: var(--max-height);
background: var(--background);
contain: strict;
}
[dir=rtl] .menu-inner, :host-context([dir=rtl]) .menu-inner {
left: unset;
right: unset;
left: auto;
right: 0;
}
[dir=rtl] .menu-inner, :host-context([dir=rtl]) .menu-inner {
transform: translate3d(calc(-1 * -9999px), 0, 0);
}
:host(.menu-side-start) .menu-inner {
--ion-safe-area-right: 0px;
/* stylelint-disable property-disallowed-list */
right: auto;
left: 0;
}
:host(.menu-side-end) .menu-inner {
--ion-safe-area-left: 0px;
right: 0;
left: auto;
/* stylelint-enable property-disallowed-list */
}
ion-backdrop {
display: none;
opacity: 0.01;
z-index: -1;
}
@media (max-width: 340px) {
.menu-inner {
--width: 264px;
}
}
:host(.menu-type-reveal) {
z-index: 0;
}
:host(.menu-type-reveal.show-menu) .menu-inner {
transform: translate3d(0, 0, 0);
}
:host(.menu-type-overlay) {
z-index: 1000;
}
:host(.menu-type-overlay) .show-backdrop {
display: block;
cursor: pointer;
}
:host(.menu-pane-visible) {
width: var(--width);
min-width: var(--min-width);
max-width: var(--max-width);
}
:host(.menu-pane-visible) .menu-inner {
left: 0;
right: 0;
width: auto;
/* stylelint-disable declaration-no-important */
transform: none ;
box-shadow: none ;
}
:host(.menu-pane-visible) ion-backdrop {
display: hidden ;
/* stylelint-enable declaration-no-important */
}
:host(.menu-type-push) {
z-index: 1000;
}
:host(.menu-type-push) .show-backdrop {
display: block;
}