/* The sheet: a drawer floating at the bottom of a phone, a dialog in the middle of a computer, × and a view's own buttons pinned in its corner, the views inside (head, line under it), and the question look (Remove, Reconnect). */ /* Closed, the sheet is out of the page (display, not visibility): each open computes its styles afresh. Hidden by visibility, Chromium could keep the inherited "hidden" on the views' box after a quick close and reopen (a double tap on Reconnect), and the sheet opened empty but for its buttons. */ .sheet-root { position: fixed; inset: 0; z-index: 50; display: none; } .sheet-root.open { display: block; } /* The dim alone, no blur behind it: a blur of the whole page would be drawn again on every frame the sheet and the dim move, and the system's own sheets dim too. */ .scrim { position: absolute; inset: 0; background: var(--scrim); } .sheet { position: absolute; left: var(--gutter-l); right: var(--gutter-r); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 400px; max-height: calc(100% - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); background: var(--raised); border-radius: var(--r-sheet); box-shadow: var(--sheet-shadow); overflow: hidden; display: flex; flex-direction: column; } /* On a computer (and a tablet held wide): a dialog in the middle of the screen, which comes up from its centre (ui/sheet.ts); a phone keeps the drawer at the bottom. The breakpoint is the one the sheet widens at for a dense code. Centred by the layout, not a transform, so its text stays on the pixel grid and its own transform stays free for the motion. */ @media (min-width: 760px) { .sheet-root.open { display: flex; align-items: center; justify-content: center; } .sheet { position: relative; left: auto; right: auto; bottom: auto; margin: 0; width: calc(100% - var(--gutter-l) - var(--gutter-r)); } } .sheet .x { position: absolute; z-index: 3; right: 22px; top: 22px; } /* The viewport: as tall as its view, give or take the gap or overhang under the view while it glides to a new height (ui/sheet.ts); what does not fit yet, and a view on its way out, is clipped. */ .vp { position: relative; overflow: hidden; flex: none; } .sheet-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; } .view { padding: 0 24px 24px; display: flex; flex-direction: column; } /* Pulled down by its head to close: the head takes the touch, the rest scrolls. */ .vhead { display: flex; align-items: center; gap: 12px; height: 76px; padding-right: 44px; flex: none; cursor: grab; touch-action: none; } .vhead h2 { flex: 1; margin: 0; font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .vhead.center h2 { text-align: center; } .vhead.with-acts { padding-right: 126px; } .vsub { margin: -16px 0 18px; color: var(--text-2); font-size: 14px; line-height: 20px; } .vhead.center + .vsub { text-align: center; margin: -6px auto 24px; max-width: 32ch; text-wrap: balance; } .view > .hint.bad-t { margin-top: 8px; } .secure-note { margin-top: 12px; text-align: center; } /* A view's own buttons beside × and pinned like it: icons only, each the size and colour of ×; the two join with tighter inner corners. */ .sheet-acts { position: absolute; z-index: 3; top: 22px; right: 58px; } /* The connection's download and copy, on its row beside the chevron: quiet icons in the chevron's grey, a knob circle behind one under the pointer. */ .hpill { position: relative; display: flex; } .hp-b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--text-2); transition: background-color 150ms, color 150ms, transform 150ms var(--ease-out); } .hp-b .i { width: 16px; height: 16px; } .hp-b:hover { background: var(--knob); color: var(--text); } .hp-b:active { transform: scale(0.94); } .hp-b.done { color: var(--ok); } /* Their tooltip: a small toast-coloured pill under the keys, one for both. */ .hp-tip { position: absolute; z-index: 4; left: 0; top: calc(100% + 8px); height: 26px; padding: 0 10px; display: flex; align-items: center; border-radius: 999px; background: var(--toast); color: var(--toast-fg); font: 500 12px/1 var(--font); letter-spacing: -0.1px; white-space: nowrap; box-shadow: 0 0 0 1px var(--line-glass), var(--pop-shadow); opacity: 0; pointer-events: none; overflow: hidden; transform-origin: 50% 0; } .hp-tip.on { opacity: 1; } .hp-tip .tt { position: relative; display: inline-flex; justify-content: center; white-space: nowrap; } .hp-tip .tt-m { position: absolute; left: 0; top: 0; visibility: hidden; white-space: nowrap; } /* Connected: nothing is left to do here, so × and the view's buttons step away; the sheet then closes by itself. A question has its own Cancel: no × beside it either. */ .sheet .x, .sheet-acts { transition: transform 150ms var(--ease-out), background-color 150ms, opacity 240ms var(--ease-out), filter 240ms var(--ease-out), scale 240ms var(--ease-out); } .sheet.arrived .x, .sheet.arrived .sheet-acts, .sheet.asks .x { opacity: 0; filter: blur(3px); scale: 0.9; pointer-events: none; } /* A question before something that cannot be undone. */ .center-col, .ask { display: flex; flex-direction: column; } .center-col { align-items: center; text-align: center; } /* A question before something that cannot be undone (Reconnect, Remove): the icon, the question and what happens on the left edge, as iOS asks now, as far from the top as from the sides; the buttons span the sheet under them. */ .ask { align-items: flex-start; text-align: left; padding-top: 24px; } .center-col.secure { padding-top: 4px; } :is(.center-col, .ask) .gi.xl { width: 64px; height: 64px; margin: 8px 0 16px; } .ask .gi.xl { margin: 0 0 18px; } :is(.center-col, .ask) h3 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.5px; } :is(.center-col, .ask) p { margin: 6px 0 22px; color: var(--text-2); font-size: 15px; line-height: 21px; } .center-col p { max-width: 30ch; text-wrap: balance; } .ask p { text-wrap: pretty; } .center-col.secure p { margin-top: 0; } .btnrow { display: flex; gap: 8px; width: 100%; } .btnrow .btn { flex: 1; } .btnrow2 { display: grid; gap: 8px; } .btnrow2 .btn { width: 100%; }