UNPKG

@ionic/core

Version:
248 lines (221 loc) • 7.35 kB
:host { /** * @prop --background: Background of the action sheet group * @prop --background-activated: Background of the activated action sheet button * @prop --background-selected: Background of the selected action sheet button * @prop --color: Color of the action sheet text * * @prop --min-width: Minimum width of the action sheet * @prop --width: Width of the action sheet * @prop --max-width: Maximum width of the action sheet * * @prop --min-height: Minimum height of the action sheet * @prop --height: height of the action sheet * @prop --max-height: Maximum height of the action sheet */ --color: initial; --min-width: auto; --width: 100%; --max-width: 500px; --min-height: auto; --height: 100%; --max-height: 100%; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; left: 0; right: 0; top: 0; bottom: 0; display: block; position: fixed; font-family: var(--ion-font-family, inherit); touch-action: none; user-select: none; z-index: 1000; } :host(.overlay-hidden) { display: none; } .action-sheet-wrapper { left: 0; right: 0; bottom: 0; margin-left: auto; margin-right: auto; margin-top: auto; margin-bottom: auto; transform: translate3d(0, 100%, 0); display: block; position: absolute; width: var(--width); min-width: var(--min-width); max-width: var(--max-width); height: var(--height); min-height: var(--min-height); max-height: var(--max-height); z-index: 10; pointer-events: none; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { .action-sheet-wrapper { margin-left: unset; margin-right: unset; -webkit-margin-start: auto; margin-inline-start: auto; -webkit-margin-end: auto; margin-inline-end: auto; } } .action-sheet-button { width: 100%; border: 0; outline: none; font-family: inherit; } .action-sheet-button.activated { background: var(--background-activated); } .action-sheet-button-inner { display: flex; flex-flow: row nowrap; flex-shrink: 0; align-items: center; justify-content: center; width: 100%; height: 100%; } .action-sheet-container { display: flex; flex-flow: column; justify-content: flex-end; height: 100%; max-height: 100%; } .action-sheet-group { flex-shrink: 2; overscroll-behavior-y: contain; overflow-y: scroll; -webkit-overflow-scrolling: touch; pointer-events: all; background: var(--background); } .action-sheet-group::-webkit-scrollbar { display: none; } .action-sheet-group-cancel { flex-shrink: 0; overflow: hidden; } .action-sheet-selected { background: var(--background-selected); } :host { --background: var(--ion-overlay-background-color, var(--ion-color-step-150, #f9f9f9)); --background-selected: var(--ion-background-color, #fff); --background-activated: rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08); text-align: center; } .action-sheet-wrapper { margin-left: auto; margin-right: auto; margin-top: var(--ion-safe-area-top, 0); margin-bottom: var(--ion-safe-area-bottom, 0); } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { .action-sheet-wrapper { margin-left: unset; margin-right: unset; -webkit-margin-start: auto; margin-inline-start: auto; -webkit-margin-end: auto; margin-inline-end: auto; } } .action-sheet-container { padding-left: 8px; padding-right: 8px; padding-top: 0; padding-bottom: 0; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { .action-sheet-container { padding-left: unset; padding-right: unset; -webkit-padding-start: 8px; padding-inline-start: 8px; -webkit-padding-end: 8px; padding-inline-end: 8px; } } .action-sheet-group { border-radius: 13px; margin-bottom: 8px; overflow: hidden; } .action-sheet-group:first-child { margin-top: 10px; } .action-sheet-group:last-child { margin-bottom: 10px; } @supports (backdrop-filter: blur(0)) { :host(.action-sheet-translucent) .action-sheet-group { background-color: transparent; backdrop-filter: saturate(280%) blur(20px); } :host(.action-sheet-translucent) .action-sheet-title, :host(.action-sheet-translucent) .action-sheet-button { background-color: transparent; background-image: linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%), linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4) 50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 50%); background-repeat: no-repeat; /* stylelint-disable-next-line all */ background-position: top, bottom; background-size: 100% calc(100% - 1px), 100% 1px; backdrop-filter: saturate(120%); } :host(.action-sheet-translucent) .action-sheet-button.activated { background-color: rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.7); background-image: none; } :host(.action-sheet-translucent) .action-sheet-cancel { background: var(--background-selected); } } .action-sheet-title, .action-sheet-button { background-color: transparent; background-image: linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%); background-repeat: no-repeat; /* stylelint-disable-next-line all */ background-position: bottom; background-size: 100% 1px; } .action-sheet-title { padding-left: 10px; padding-right: 10px; padding-top: 14px; padding-bottom: 13px; color: var(--color, var(--ion-color-step-400, #999999)); font-size: 13px; font-weight: 400; text-align: center; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { .action-sheet-title { padding-left: unset; padding-right: unset; -webkit-padding-start: 10px; padding-inline-start: 10px; -webkit-padding-end: 10px; padding-inline-end: 10px; } } .action-sheet-sub-title { padding-left: 0; padding-right: 0; padding-top: 15px; padding-bottom: 0; font-size: 12px; } .action-sheet-button { padding-left: 18px; padding-right: 18px; padding-top: 18px; padding-bottom: 18px; height: 56px; color: var(--color, var(--ion-color-primary, #3880ff)); font-size: 20px; contain: strict; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { .action-sheet-button { padding-left: unset; padding-right: unset; -webkit-padding-start: 18px; padding-inline-start: 18px; -webkit-padding-end: 18px; padding-inline-end: 18px; } } .action-sheet-button .action-sheet-icon { margin-right: 0.1em; font-size: 28px; } @supports (margin-inline-start: 0) or (-webkit-margin-start: 0) { .action-sheet-button .action-sheet-icon { margin-right: unset; -webkit-margin-end: 0.1em; margin-inline-end: 0.1em; } } .action-sheet-button:last-child { background-image: none; } .action-sheet-selected { background: var(--background-selected); font-weight: bold; } .action-sheet-destructive { color: var(--ion-color-danger, #f04141); } .action-sheet-cancel { background: var(--background-selected); font-weight: 600; }