@import './theme.css'; .react-aria-Sheet { background: var(--overlay-background); color: var(--text-color); outline: 1px solid var(--overlay-border); box-shadow: var(--popover-shadow); font-family: system-ui; font-size: var(--font-size); height: auto; max-height: calc(100% - 32px); width: calc(100% - var(--spacing-3)); max-width: 800px; margin: var(--spacing-2); border-radius: 32px; overflow: clip; z-index: 1; /* Establish a 3D space so stacked sheets can scale backward along the z-axis. */ transform: perspective(1000px); will-change: transform; &[data-position='left'], &[data-position='right'] { width: 340px; height: calc(100% - var(--spacing-3)); max-height: unset; } &[data-position='bottom'], &[data-position='center'] { transform-origin: center -150px; } &[data-position='top'] { transform-origin: center 150px; } &[data-position='left'] { transform-origin: 150px center; } &[data-position='right'] { transform-origin: -150px center; } .sheet-handle { border-radius: 6px; background: var(--gray-300); position: absolute; z-index: 2; transition: opacity 300ms; } &[data-swipe-direction='bottom'] .sheet-handle, &[data-swipe-direction='vertical'] .sheet-handle { top: 12px; left: 50%; transform: translateX(-50%); width: 80px; height: 6px; } &[data-swipe-direction='top'] .sheet-handle { bottom: 12px; left: 50%; transform: translateX(-50%); width: 80px; height: 6px; } &[data-swipe-direction='left'] .sheet-handle, &[data-swipe-direction='horizontal'] .sheet-handle { right: 12px; top: 50%; transform: translateY(-50%); height: 80px; width: 6px; } &[data-swipe-direction='right'] .sheet-handle { left: 12px; top: 50%; transform: translateY(-50%); height: 80px; width: 6px; } &[data-has-descendants] .sheet-handle { opacity: 0; } } .react-aria-SheetBackdrop { /* Only the bottom-most sheet in a stack dims the page behind it. */ &[data-stack-index='0'] { background: rgb(0 0 0 / 0.4); } } .react-aria-SheetContent { padding: var(--spacing-8); padding-bottom: calc(var(--spacing-8) + var(--sheet-scroll-padding-y)); mask-image: linear-gradient( to bottom, transparent 0px var(--spacing-4), black var(--spacing-8) calc(100% - var(--spacing-8)), transparent ); box-sizing: border-box; height: 100%; outline: none; /* Only scroll the inner content once the sheet is fully expanded. At a partial detent a swipe on the content chains out to the sheet's scroll container instead, expanding the sheet (like iOS). */ overflow: hidden; overscroll-behavior: auto; scrollbar-gutter: stable; .react-aria-Heading[slot='title'] { margin-top: 0; margin-bottom: var(--spacing-1); font-size: 1.3rem; } } .react-aria-SheetOverlay[data-expanded] .react-aria-SheetContent { overflow: auto; } @keyframes sheet-backdrop { from { opacity: 0; } to { opacity: 1; } } @keyframes sheet-scale-back { to { transform: translateZ(-120px); } }