@ionic/core
Version:
Base components for Ionic
135 lines (124 loc) • 3.7 kB
CSS
/**
* Convert a font size to a dynamic font size.
* Fonts that participate in Dynamic Type should use
* dynamic font sizes.
* @param size - The initial font size including the unit (i.e. px or pt)
* @param unit (optional) - The unit to convert to. Use this if you want to
* convert to a unit other than $baselineUnit.
*/
/**
* Convert a font size to a dynamic font size but impose
* a maximum font size.
* @param size - The initial font size including the unit (i.e. px or pt)
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
* convert to a unit other than $baselineUnit.
*/
/**
* Convert a font size to a dynamic font size but impose
* a minimum font size.
* @param size - The initial font size including the unit (i.e. px or pt)
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
* convert to a unit other than $baselineUnit.
*/
/**
* Convert a font size to a dynamic font size but impose
* maximum and minimum font sizes.
* @param size - The initial font size including the unit (i.e. px or pt)
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
* convert to a unit other than $baselineUnit.
*/
/**
* A heuristic that applies CSS to tablet
* viewports.
*
* Usage:
* @include tablet-viewport() {
* :host {
* background-color: green;
* }
* }
*/
/**
* A heuristic that applies CSS to mobile
* viewports (i.e. phones, not tablets).
*
* Usage:
* @include mobile-viewport() {
* :host {
* background-color: blue;
* }
* }
*/
:host {
display: block;
position: relative;
width: 100%;
background-color: var(--ion-background-color, #ffffff);
overflow: hidden;
/**
* This is required to force WebKit
* to create a new stacking context
* otherwise the border radius is
* temporarily lost when hovering over
* the ion-item or expanding/collapsing
* the accordion.
*/
z-index: 0;
}
:host(.accordion-expanding) ::slotted(ion-item[slot=header]),
:host(.accordion-expanded) ::slotted(ion-item[slot=header]) {
--border-width: 0px;
}
:host(.accordion-animated) {
transition: all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);
}
:host(.accordion-animated) #content {
transition: max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);
}
#content {
overflow: hidden;
will-change: max-height;
}
:host(.accordion-collapsing) #content {
/* stylelint-disable-next-line declaration-no-important */
max-height: 0 ;
}
:host(.accordion-collapsed) #content {
display: none;
}
:host(.accordion-expanding) #content {
max-height: 0;
}
/**
* Prevent margins of content-wrapper
* from collapsing, breaking the animation.
*/
:host(.accordion-expanding) #content-wrapper {
overflow: auto;
}
:host(.accordion-disabled) #header,
:host(.accordion-readonly) #header,
:host(.accordion-disabled) #content,
:host(.accordion-readonly) #content {
pointer-events: none;
}
/**
* We do not set the opacity on the
* host otherwise you would see the
* box-shadow behind it.
*/
:host(.accordion-disabled) #header,
:host(.accordion-disabled) #content {
opacity: 0.4;
}
@media (prefers-reduced-motion: reduce) {
:host,
#content {
/* stylelint-disable declaration-no-important */
transition: none ;
}
}