UNPKG

@ionic/core

Version:
202 lines (194 loc) 6.05 kB
/** * 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; * } * } */ /** * 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 { margin-left: 0; margin-right: 0; margin-top: calc(100% + 10px); margin-bottom: calc(100% + 10px); display: none; position: absolute; top: 0; flex-direction: column; align-items: center; /** * The list should be centered relative to the parent * FAB button. We set minimum dimensions so the * FAB list can be centered relative to the small FAB button. * However, the small FAB button adds start/end margin, so we need * to account for that in the FAB list dimensions. */ min-width: 56px; min-height: 56px; } :host(.fab-list-active) { display: flex; } ::slotted(.fab-button-in-list) { margin-left: 0; margin-right: 0; margin-top: 8px; margin-bottom: 8px; width: 40px; height: 40px; transform: scale(0); opacity: 0; visibility: hidden; } :host(.fab-list-side-top) ::slotted(.fab-button-in-list), :host(.fab-list-side-bottom) ::slotted(.fab-button-in-list) { margin-left: 0; margin-right: 0; margin-top: 5px; margin-bottom: 5px; } :host(.fab-list-side-start) ::slotted(.fab-button-in-list), :host(.fab-list-side-end) ::slotted(.fab-button-in-list) { -webkit-margin-start: 5px; margin-inline-start: 5px; -webkit-margin-end: 5px; margin-inline-end: 5px; margin-top: 0; margin-bottom: 0; } ::slotted(.fab-button-in-list.fab-button-show) { transform: scale(1); opacity: 1; visibility: visible; } :host(.fab-list-side-top) { top: auto; bottom: 0; flex-direction: column-reverse; } :host(.fab-list-side-start) { -webkit-margin-start: calc(100% + 10px); margin-inline-start: calc(100% + 10px); -webkit-margin-end: calc(100% + 10px); margin-inline-end: calc(100% + 10px); margin-top: 0; margin-bottom: 0; flex-direction: row-reverse; } :host(.fab-list-side-start) { inset-inline-end: 0; } :host(.fab-list-side-end) { -webkit-margin-start: calc(100% + 10px); margin-inline-start: calc(100% + 10px); -webkit-margin-end: calc(100% + 10px); margin-inline-end: calc(100% + 10px); margin-top: 0; margin-bottom: 0; flex-direction: row; } :host(.fab-list-side-end) { inset-inline-start: 0; }