/* Overlay */ /* TODO: One day this can be :has(:modal), when it is better supported */ body.has-modal { overflow: hidden !important; padding-right: var(--dialog-scrollgutter) !important; } dialog.Overlay:not([open]) { display: none; } .Overlay--hidden { display: none !important; } .Overlay--visibilityHidden { height: 0; overflow: hidden; visibility: hidden; opacity: 0; } /* This is for @oddbird/popover-polyfill; * A FOUC occurs in browsers which do not support :popover-open. * We can try to hide the popover if :popover-open is not supported. */ @supports not selector(:popover-open) { [popover]:not(.\:popover-open) { display: none; } } .Overlay { display: flex; inset: 0; position: static; margin: auto; padding: 0; width: min(var(--overlay-width), 100vw - 2rem); min-width: 192px; max-height: min(calc(100vh - 2rem), var(--overlay-height)); white-space: normal; flex-direction: column; background-color: var(--overlay-bgColor); color: var(--fgColor-default); border: 0; border-radius: var(--borderRadius-large); box-shadow: var(--shadow-floating-small); opacity: 1; &.Overlay--size-auto { min-width: 192px; max-width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); } &.Overlay--size-full { width: 100vw; height: 100vh; } &.Overlay--size-xsmall { --overlay-width: 192px; max-height: calc(100vh - 2rem); } &.Overlay--size-small { --overlay-height: 256px; --overlay-width: 320px; } &.Overlay--size-small-portrait { --overlay-height: 432px; --overlay-width: 320px; } &.Overlay--size-medium { --overlay-height: 320px; --overlay-width: 480px; } &.Overlay--size-medium-portrait { --overlay-height: 600px; --overlay-width: 480px; } &.Overlay--size-large { --overlay-height: 432px; --overlay-width: 640px; } &.Overlay--size-xlarge { --overlay-height: 600px; --overlay-width: 960px; } &.Overlay--height-auto { height: auto; } &.Overlay--placement-left, &.Overlay--placement-right { height: 100%; max-height: unset; position: fixed; } &.Overlay--motion-scaleFade, &.Overlay--placement-left, &.Overlay--placement-right { @media screen and (prefers-reduced-motion: no-preference) { animation: 200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running Overlay--motion-scaleFade; } } &.Overlay--placement-left { inset: 0 auto 0 0; border-top-left-radius: 0; border-bottom-left-radius: 0; animation-name: Overlay--motion-slideInRight; } &.Overlay--placement-right { inset: 0 0 0 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; animation-name: Overlay--motion-slideInLeft; } /* start deprecate in favor of Alpha::Dialog */ &.Overlay--height-xsmall { height: min(192px, 100vh - 2rem); } &.Overlay--height-small { height: min(256px, 100vh - 2rem); } &.Overlay--height-medium { height: min(320px, 100vh - 2rem); } &.Overlay--height-large { height: min(432px, 100vh - 2rem); } &.Overlay--height-xlarge { height: min(600px, 100vh - 2rem); } &.Overlay--width-auto { width: auto; } &.Overlay--width-small { width: min(256px, 100vw - 2rem); } &.Overlay--width-medium { width: min(320px, 100vw - 2rem); } &.Overlay--width-large { width: min(480px, 100vw - 2rem); } &.Overlay--width-xlarge { width: min(640px, 100vw - 2rem); } &.Overlay--width-xxlarge { width: min(960px, 100vw - 2rem); } /* end deprecate */ } .Overlay:modal { position: fixed; } @keyframes Overlay--motion-scaleFade { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: scale(1); } } /* for