@ionic/core
Version:
Base components for Ionic
236 lines (224 loc) • 6.45 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 {
/**
* @prop --background: Background of the item option
* @prop --color: Color of the item option
*/
--background: var(--ion-color-primary, #0054e9);
--color: var(--ion-color-primary-contrast, #fff);
background: var(--background);
color: var(--color);
font-family: var(--ion-font-family, inherit);
}
:host(.ion-color) {
background: var(--ion-color-base);
color: var(--ion-color-contrast);
}
.button-native {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
letter-spacing: inherit;
text-decoration: inherit;
text-indent: inherit;
text-overflow: inherit;
text-transform: inherit;
text-align: inherit;
white-space: inherit;
color: inherit;
-webkit-padding-start: 0.7em;
padding-inline-start: 0.7em;
-webkit-padding-end: 0.7em;
padding-inline-end: 0.7em;
padding-top: 0;
padding-bottom: 0;
display: inline-block;
position: relative;
width: 100%;
height: 100%;
border: 0;
outline: none;
background: transparent;
cursor: pointer;
appearance: none;
box-sizing: border-box;
}
.button-inner {
display: flex;
flex-flow: column nowrap;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.horizontal-wrapper {
display: flex;
flex-flow: row nowrap;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 100%;
}
::slotted(*) {
flex-shrink: 0;
}
::slotted([slot=start]) {
-webkit-margin-start: 0;
margin-inline-start: 0;
-webkit-margin-end: 5px;
margin-inline-end: 5px;
margin-top: 0;
margin-bottom: 0;
}
::slotted([slot=end]) {
-webkit-margin-start: 5px;
margin-inline-start: 5px;
-webkit-margin-end: 0;
margin-inline-end: 0;
margin-top: 0;
margin-bottom: 0;
}
::slotted([slot=icon-only]) {
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-margin-start: 10px;
margin-inline-start: 10px;
-webkit-margin-end: 10px;
margin-inline-end: 10px;
margin-top: 0;
margin-bottom: 0;
min-width: 0.9em;
font-size: 1.8em;
}
:host(.item-option-expandable) {
flex-shrink: 0;
transition-duration: 0;
transition-property: none;
transition-timing-function: cubic-bezier(0.65, 0.05, 0.36, 1);
}
:host(.item-option-disabled) {
pointer-events: none;
}
:host(.item-option-disabled) .button-native {
cursor: default;
opacity: 0.5;
pointer-events: none;
}
/**
* 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 {
font-size: 0.875rem;
font-weight: 500;
text-transform: uppercase;
}