@ionic/core
Version:
Base components for Ionic
232 lines (214 loc) • 5.21 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 --color: Color of the spinner
*/
display: inline-block;
position: relative;
width: 28px;
height: 28px;
color: var(--color);
user-select: none;
}
:host(.ion-color) {
color: var(--ion-color-base);
}
svg {
transform-origin: center;
position: absolute;
/**
* Do not use @include position
* as the alignment of the elements with
* a spinner should not be RTL aware.
*/
top: 0;
/* stylelint-disable-next-line property-disallowed-list */
left: 0;
width: 100%;
height: 100%;
transform: translateZ(0);
}
:host-context([dir=rtl]) svg {
transform-origin: calc(100% - center);
}
[dir=rtl] svg {
transform-origin: calc(100% - center);
}
@supports selector(:dir(rtl)) {
svg:dir(rtl) {
transform-origin: calc(100% - center);
}
}
:host(.spinner-lines) line,
:host(.spinner-lines-small) line {
stroke-width: 7px;
}
:host(.spinner-lines-sharp) line,
:host(.spinner-lines-sharp-small) line {
stroke-width: 4px;
}
:host(.spinner-lines) line,
:host(.spinner-lines-small) line,
:host(.spinner-lines-sharp) line,
:host(.spinner-lines-sharp-small) line {
stroke-linecap: round;
stroke: currentColor;
}
:host(.spinner-lines) svg,
:host(.spinner-lines-small) svg,
:host(.spinner-lines-sharp) svg,
:host(.spinner-lines-sharp-small) svg {
animation: spinner-fade-out 1s linear infinite;
}
:host(.spinner-bubbles) svg {
animation: spinner-scale-out 1s linear infinite;
fill: currentColor;
}
:host(.spinner-circles) svg {
animation: spinner-fade-out 1s linear infinite;
fill: currentColor;
}
:host(.spinner-crescent) circle {
fill: transparent;
stroke-width: 4px;
stroke-dasharray: 128px;
stroke-dashoffset: 82px;
stroke: currentColor;
}
:host(.spinner-crescent) svg {
animation: spinner-rotate 1s linear infinite;
}
:host(.spinner-dots) circle {
stroke-width: 0;
fill: currentColor;
}
:host(.spinner-dots) svg {
animation: spinner-dots 1s linear infinite;
}
:host(.spinner-circular) svg {
animation: spinner-circular linear infinite;
}
:host(.spinner-circular) circle {
animation: spinner-circular-inner ease-in-out infinite;
stroke: currentColor;
stroke-dasharray: 80px, 200px;
stroke-dashoffset: 0px;
stroke-width: 5.6;
fill: none;
}
:host(.spinner-paused),
:host(.spinner-paused) svg,
:host(.spinner-paused) circle {
animation-play-state: paused;
}
@keyframes spinner-fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes spinner-scale-out {
0% {
transform: scale(1, 1);
}
100% {
transform: scale(0, 0);
}
}
@keyframes spinner-rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes spinner-dots {
0% {
transform: scale(1, 1);
opacity: 0.9;
}
50% {
transform: scale(0.4, 0.4);
opacity: 0.3;
}
100% {
transform: scale(1, 1);
opacity: 0.9;
}
}
@keyframes spinner-circular {
100% {
transform: rotate(360deg);
}
}
@keyframes spinner-circular-inner {
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0px;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -125px;
}
}