UNPKG

@ionic/angular

Version:

Angular specific wrappers for @ionic/core

542 lines (498 loc) • 18.3 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; * } * } */ /** * 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; * } * } */ html.ios { --ion-default-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Roboto", sans-serif; } html.md { --ion-default-font: "Roboto", "Helvetica Neue", sans-serif; } html { --ion-default-dynamic-font: -apple-system-body; --ion-font-family: var(--ion-default-font); } body { background: var(--ion-background-color); } body.backdrop-no-scroll { overflow: hidden; } /** * Card style modal needs additional padding on the * top of the header. We accomplish this by targeting * the first toolbar in the header. * Footer also needs this. We do not adjust the bottom * padding though because of the safe area. */ html.ios ion-modal.modal-card ion-header ion-toolbar:first-of-type, html.ios ion-modal.modal-sheet ion-header ion-toolbar:first-of-type, html.ios ion-modal ion-footer ion-toolbar:first-of-type { padding-top: 6px; } /** * Card style modal needs additional padding on the * bottom of the header. We accomplish this by targeting * the last toolbar in the header. */ html.ios ion-modal.modal-card ion-header ion-toolbar:last-of-type, html.ios ion-modal.modal-sheet ion-header ion-toolbar:last-of-type { padding-bottom: 6px; } /** * Add padding on the left and right * of toolbars while accounting for * safe area values when in landscape. */ html.ios ion-modal ion-toolbar { padding-right: calc(var(--ion-safe-area-right) + 8px); padding-left: calc(var(--ion-safe-area-left) + 8px); } /** * Card style modal on iPadOS * should only have backdrop on first instance. */ @media screen and (min-width: 768px) { html.ios ion-modal.modal-card:first-of-type { --backdrop-opacity: 0.18; } } /** * Subsequent modals should not have a backdrop/box shadow * as it will cause the screen to appear to get progressively * darker. With Ionic 6, declarative modals made it * possible to have multiple non-presented modals in the DOM, * so we could no longer rely on ion-modal:first-of-type. * Here we disable the opacity/box-shadow for every modal * that comes after the first presented modal. * * Note: ion-modal:not(.overlay-hidden):first-of-type * does not match the first modal to not have * the .overlay-hidden class, it will match the * first modal in general only if it does not * have the .overlay-hidden class. * The :nth-child() pseudo-class has support * for selectors which would help us here. At the * time of writing it does not have great cross browser * support. * * Note 2: This should only apply to non-card and * non-sheet modals. Card and sheet modals have their * own criteria for displaying backdrops/box shadows. * * Do not use :not(.overlay-hidden) in place of * .show-modal because that triggers a memory * leak in Blink: https://bugs.chromium.org/p/chromium/issues/detail?id=1418768 */ ion-modal.modal-default.show-modal ~ ion-modal.modal-default { --backdrop-opacity: 0; --box-shadow: none; } /** * This works around a bug in WebKit where the * content will overflow outside of the bottom border * radius when re-painting. As long as a single * border radius value is set on .ion-page, this * issue does not happen. We set the top left radius * here because the top left corner will always have a * radius no matter the platform. * This behavior only applies to card modals. */ html.ios ion-modal.modal-card .ion-page { border-top-left-radius: var(--border-radius); } .ion-color-primary { --ion-color-base: var(--ion-color-primary, #3880ff) !important; --ion-color-base-rgb: var(--ion-color-primary-rgb, 56, 128, 255) !important; --ion-color-contrast: var(--ion-color-primary-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-primary-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-primary-shade, #3171e0) !important; --ion-color-tint: var(--ion-color-primary-tint, #4c8dff) !important; } .ion-color-secondary { --ion-color-base: var(--ion-color-secondary, #3dc2ff) !important; --ion-color-base-rgb: var(--ion-color-secondary-rgb, 61, 194, 255) !important; --ion-color-contrast: var(--ion-color-secondary-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-secondary-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-secondary-shade, #36abe0) !important; --ion-color-tint: var(--ion-color-secondary-tint, #50c8ff) !important; } .ion-color-tertiary { --ion-color-base: var(--ion-color-tertiary, #5260ff) !important; --ion-color-base-rgb: var(--ion-color-tertiary-rgb, 82, 96, 255) !important; --ion-color-contrast: var(--ion-color-tertiary-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-tertiary-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-tertiary-shade, #4854e0) !important; --ion-color-tint: var(--ion-color-tertiary-tint, #6370ff) !important; } .ion-color-success { --ion-color-base: var(--ion-color-success, #2dd36f) !important; --ion-color-base-rgb: var(--ion-color-success-rgb, 45, 211, 111) !important; --ion-color-contrast: var(--ion-color-success-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-success-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-success-shade, #28ba62) !important; --ion-color-tint: var(--ion-color-success-tint, #42d77d) !important; } .ion-color-warning { --ion-color-base: var(--ion-color-warning, #ffc409) !important; --ion-color-base-rgb: var(--ion-color-warning-rgb, 255, 196, 9) !important; --ion-color-contrast: var(--ion-color-warning-contrast, #000) !important; --ion-color-contrast-rgb: var(--ion-color-warning-contrast-rgb, 0, 0, 0) !important; --ion-color-shade: var(--ion-color-warning-shade, #e0ac08) !important; --ion-color-tint: var(--ion-color-warning-tint, #ffca22) !important; } .ion-color-danger { --ion-color-base: var(--ion-color-danger, #eb445a) !important; --ion-color-base-rgb: var(--ion-color-danger-rgb, 235, 68, 90) !important; --ion-color-contrast: var(--ion-color-danger-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-danger-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-danger-shade, #cf3c4f) !important; --ion-color-tint: var(--ion-color-danger-tint, #ed576b) !important; } .ion-color-light { --ion-color-base: var(--ion-color-light, #f4f5f8) !important; --ion-color-base-rgb: var(--ion-color-light-rgb, 244, 245, 248) !important; --ion-color-contrast: var(--ion-color-light-contrast, #000) !important; --ion-color-contrast-rgb: var(--ion-color-light-contrast-rgb, 0, 0, 0) !important; --ion-color-shade: var(--ion-color-light-shade, #d7d8da) !important; --ion-color-tint: var(--ion-color-light-tint, #f5f6f9) !important; } .ion-color-medium { --ion-color-base: var(--ion-color-medium, #92949c) !important; --ion-color-base-rgb: var(--ion-color-medium-rgb, 146, 148, 156) !important; --ion-color-contrast: var(--ion-color-medium-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-medium-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-medium-shade, #808289) !important; --ion-color-tint: var(--ion-color-medium-tint, #9d9fa6) !important; } .ion-color-dark { --ion-color-base: var(--ion-color-dark, #222428) !important; --ion-color-base-rgb: var(--ion-color-dark-rgb, 34, 36, 40) !important; --ion-color-contrast: var(--ion-color-dark-contrast, #fff) !important; --ion-color-contrast-rgb: var(--ion-color-dark-contrast-rgb, 255, 255, 255) !important; --ion-color-shade: var(--ion-color-dark-shade, #1e2023) !important; --ion-color-tint: var(--ion-color-dark-tint, #383a3e) !important; } .ion-page { left: 0; right: 0; top: 0; bottom: 0; display: flex; position: absolute; flex-direction: column; justify-content: space-between; contain: layout size style; z-index: 0; } /** * When making custom dialogs, using * ion-content is not required. As a result, * some developers may wish to have dialogs * that are automatically sized by the browser. * These changes allow certain dimension values * such as fit-content to work correctly. */ ion-modal > .ion-page { position: relative; contain: layout style; height: 100%; } .split-pane-visible > .ion-page.split-pane-main { position: relative; } ion-route, ion-route-redirect, ion-router, ion-select-option, ion-nav-controller, ion-menu-controller, ion-action-sheet-controller, ion-alert-controller, ion-loading-controller, ion-modal-controller, ion-picker-controller, ion-popover-controller, ion-toast-controller, .ion-page-hidden { /* stylelint-disable-next-line declaration-no-important */ display: none !important; } .ion-page-invisible { opacity: 0; } .can-go-back > ion-header ion-back-button { display: block; } html.plt-ios.plt-hybrid, html.plt-ios.plt-pwa { --ion-statusbar-padding: 20px; } @supports (padding-top: 20px) { html { --ion-safe-area-top: var(--ion-statusbar-padding); } } @supports (padding-top: constant(safe-area-inset-top)) { html { --ion-safe-area-top: constant(safe-area-inset-top); --ion-safe-area-bottom: constant(safe-area-inset-bottom); --ion-safe-area-left: constant(safe-area-inset-left); --ion-safe-area-right: constant(safe-area-inset-right); } } @supports (padding-top: env(safe-area-inset-top)) { html { --ion-safe-area-top: env(safe-area-inset-top); --ion-safe-area-bottom: env(safe-area-inset-bottom); --ion-safe-area-left: env(safe-area-inset-left); --ion-safe-area-right: env(safe-area-inset-right); } } ion-card.ion-color .ion-inherit-color, ion-card-header.ion-color .ion-inherit-color { color: inherit; } .menu-content { transform: translate3d(0, 0, 0); } .menu-content-open { cursor: pointer; touch-action: manipulation; pointer-events: none; } .ios .menu-content-reveal { box-shadow: -8px 0 42px rgba(0, 0, 0, 0.08); } [dir=rtl].ios .menu-content-reveal { box-shadow: 8px 0 42px rgba(0, 0, 0, 0.08); } .md .menu-content-reveal { box-shadow: 4px 0px 16px rgba(0, 0, 0, 0.18); } .md .menu-content-push { box-shadow: 4px 0px 16px rgba(0, 0, 0, 0.18); } ion-accordion-group.accordion-group-expand-inset > ion-accordion:first-of-type { border-top-left-radius: 8px; border-top-right-radius: 8px; } ion-accordion-group.accordion-group-expand-inset > ion-accordion:last-of-type { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; } ion-accordion-group > ion-accordion:last-of-type ion-item[slot=header] { --border-width: 0px; } ion-accordion.accordion-animated > [slot=header] .ion-accordion-toggle-icon { transition: 300ms transform cubic-bezier(0.25, 0.8, 0.5, 1); } @media (prefers-reduced-motion: reduce) { ion-accordion .ion-accordion-toggle-icon { /* stylelint-disable declaration-no-important */ transition: none !important; } } /** * The > [slot="header"] selector ensures that we do * not modify toggle icons for any nested accordions. The state * of one accordion should not affect any accordions inside * of a nested accordion group. */ ion-accordion.accordion-expanding > [slot=header] .ion-accordion-toggle-icon, ion-accordion.accordion-expanded > [slot=header] .ion-accordion-toggle-icon { transform: rotate(180deg); } ion-accordion-group.accordion-group-expand-inset.md > ion-accordion.accordion-previous ion-item[slot=header] { --border-width: 0px; --inner-border-width: 0px; } ion-accordion-group.accordion-group-expand-inset.md > ion-accordion.accordion-expanding:first-of-type, ion-accordion-group.accordion-group-expand-inset.md > ion-accordion.accordion-expanded:first-of-type { margin-top: 0; } ion-input input::-webkit-date-and-time-value { text-align: start; } /** * The .ion-datetime-button-overlay class contains * styles that allow any modal/popover to be * sized according to the dimensions of the datetime * when used with ion-datetime-button. */ .ion-datetime-button-overlay { --width: fit-content; --height: fit-content; } /** * The grid variant can scale down when inline. * When used in a `fit-content` overlay, this causes * the overlay to shrink when the month/year picker is open. * Explicitly setting the dimensions lets us have a consistently * sized grid interface. */ .ion-datetime-button-overlay ion-datetime.datetime-grid { width: 320px; min-height: 320px; } /*# sourceMappingURL=core.css.map */