UNPKG

@ionic/core

Version:
231 lines (198 loc) • 5.86 kB
:host { /** * @prop --background: Background of the tab button * @prop --background-focused: Background of the focused tab button * * @prop --color: Color of the tab button * @prop --color-selected: Color of the selected tab button * * @prop --padding-top: Top padding of the tab button * @prop --padding-end: End padding of the tab button * @prop --padding-bottom: Bottom padding of the tab button * @prop --padding-start: Start padding of the tab button * * @prop --ripple-color: Color of the button ripple effect */ --ripple-color: var(--color-selected); flex: 1; flex-direction: column; align-items: center; justify-content: center; height: 100%; background: var(--background); color: var(--color); } a { margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding-left: var(--padding-start); padding-right: var(--padding-end); padding-top: var(--padding-top); padding-bottom: var(--padding-bottom); font-family: inherit; font-size: inherit; font-style: inherit; font-weight: inherit; letter-spacing: inherit; text-decoration: inherit; text-overflow: inherit; text-transform: inherit; text-align: inherit; white-space: inherit; color: inherit; display: flex; position: relative; flex-direction: inherit; align-items: inherit; justify-content: inherit; width: 100%; height: 100%; border: 0; outline: none; background: transparent; text-decoration: none; cursor: pointer; overflow: hidden; box-sizing: border-box; -webkit-user-drag: none; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { a { padding-left: unset; padding-right: unset; -webkit-padding-start: var(--padding-start); padding-inline-start: var(--padding-start); -webkit-padding-end: var(--padding-end); padding-inline-end: var(--padding-end); } } a:focus-visible { background: var(--background-focused); } @media (any-hover: hover) { a:hover { color: var(--color-selected); } } :host(.tab-selected) { color: var(--color-selected); } :host(.tab-hidden) { /* stylelint-disable-next-line declaration-no-important */ display: none !important; } :host(.tab-disabled) { pointer-events: none; opacity: .4; } ::slotted(ion-label), ::slotted(ion-icon) { display: block; align-self: center; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; box-sizing: border-box; } ::slotted(ion-label) { order: 0; } ::slotted(ion-icon) { order: -1; height: 1em; } :host(.tab-has-label-only) ::slotted(ion-label) { white-space: normal; } ::slotted(ion-badge) { box-sizing: border-box; position: absolute; z-index: 1; } :host(.tab-layout-icon-start) { flex-direction: row; } :host(.tab-layout-icon-end) { flex-direction: row-reverse; } :host(.tab-layout-icon-bottom) { flex-direction: column-reverse; } :host(.tab-layout-icon-hide) ::slotted(ion-icon) { display: none; } :host(.tab-layout-label-hide) ::slotted(ion-label) { display: none; } ion-ripple-effect { color: var(--ripple-color); } :host { --padding-top: 0; --padding-end: 2px; --padding-bottom: 0; --padding-start: 2px; max-width: 240px; font-size: 10px; } :host(.tab-has-label-only) ::slotted(ion-label) { margin-left: 0; margin-right: 0; margin-top: 2px; margin-bottom: 2px; font-size: 12px; font-size: 14px; line-height: 1.1; } ::slotted(ion-badge) { padding-left: 6px; padding-right: 6px; padding-top: 1px; padding-bottom: 1px; left: calc(50% + 6px); top: 4px; height: auto; font-size: 12px; line-height: 16px; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { ::slotted(ion-badge) { padding-left: unset; padding-right: unset; -webkit-padding-start: 6px; padding-inline-start: 6px; -webkit-padding-end: 6px; padding-inline-end: 6px; } } :host-context([dir=rtl]) ::slotted(ion-badge) { right: calc(50% + 6px); } ::slotted(ion-icon) { margin-top: 4px; font-size: 30px; } ::slotted(ion-icon::before) { vertical-align: top; } ::slotted(ion-label) { margin-top: 0; margin-bottom: 1px; min-height: 11px; } :host(.tab-layout-icon-end) ::slotted(ion-label), :host(.tab-layout-icon-start) ::slotted(ion-label), :host(.tab-layout-icon-hide) ::slotted(ion-label) { margin-top: 2px; margin-bottom: 2px; font-size: 14px; line-height: 1.1; } :host(.tab-layout-icon-end) ::slotted(ion-icon), :host(.tab-layout-icon-start) ::slotted(ion-icon) { min-width: 24px; height: 26px; margin-top: 2px; margin-bottom: 1px; font-size: 24px; } :host(.tab-layout-icon-bottom) ::slotted(ion-badge) { left: calc(50% + 12px); } :host([dir=rtl].tab-layout-icon-bottom) ::slotted(ion-badge) { right: calc(50% + 12px); } :host(.tab-layout-icon-bottom) ::slotted(ion-icon) { margin-top: 0; margin-bottom: 1px; } :host(.tab-layout-icon-bottom) ::slotted(ion-label) { margin-top: 4px; } :host(.tab-layout-icon-start) ::slotted(ion-badge), :host(.tab-layout-icon-end) ::slotted(ion-badge) { left: calc(50% + 35px); top: 10px; } :host([dir=rtl].tab-layout-icon-start) ::slotted(ion-badge), :host([dir=rtl].tab-layout-icon-end) ::slotted(ion-badge) { right: calc(50% + 35px); } :host(.tab-layout-icon-hide) ::slotted(ion-badge), :host(.tab-has-label-only) ::slotted(ion-badge) { left: calc(50% + 30px); top: 10px; } :host([dir=rtl].tab-layout-icon-hide) ::slotted(ion-badge), :host([dir=rtl].tab-has-label-only) ::slotted(ion-badge) { right: calc(50% + 30px); } :host(.tab-layout-label-hide) ::slotted(ion-badge), :host(.tab-has-icon-only) ::slotted(ion-badge) { top: 10px; } :host(.tab-layout-label-hide) ::slotted(ion-icon) { margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; }