3syisgbyq: Add a reusable bottom sheet with the comments and composer sheets on the phone feed

This commit is contained in:
2026-10-20 08:42:32 -06:00
parent c94da3accd
commit f4f3ae28fc
5 changed files with 255 additions and 3 deletions
+93
View File
@@ -0,0 +1,93 @@
/*
* Bottom sheets (spec "Sheets"). Ported from the mockup's .psheet, .grab,
* .psheet-h and .ph-bg rules, plus the `.mx.sheet .cmp` composer rules. Tokens
* only. The sheet sits inside the phone feed (.reel-feed), over the dock.
*/
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-bg {
position: absolute;
inset: 0;
z-index: 55;
appearance: none;
border: 0;
padding: 0;
cursor: pointer;
background: color-mix(in srgb, var(--bg), transparent 50%);
-webkit-backdrop-filter: blur(3px);
backdrop-filter: blur(3px);
animation: sheet-fade .3s both;
}
.sheet {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 60;
display: flex;
flex-direction: column;
gap: 10px;
max-height: 78%;
padding: 10px 14px calc(24px + env(safe-area-inset-bottom, 0px));
background: var(--bg);
color: var(--ink);
border-radius: 26px 26px 0 0;
box-shadow: 0 -20px 50px -10px color-mix(in srgb, var(--neu-d), transparent 45%), inset 0 1px 0 var(--line);
animation: sheet-up .45s cubic-bezier(.2,.9,.25,1) both;
outline: none;
}
.sheet-grab {
flex: none;
width: 40px;
height: 5px;
margin: 0 auto 4px;
border-radius: 3px;
background: var(--line-2);
}
.sheet-h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-h h2 { margin: 0; font-size: 25px; line-height: 1.2; }
.sheet-x {
appearance: none;
flex: none;
width: 44px;
height: 44px;
margin: 0;
padding: 0;
border: 0;
border-radius: var(--r-ctl);
display: grid;
place-items: center;
background: transparent;
color: var(--ink-2);
cursor: pointer;
transition: background-color .2s, color .2s;
}
.sheet-x svg { width: 20px; height: 20px; }
@media (hover: hover) { .sheet-x:hover { background: var(--tile-2); color: var(--ink); } }
.sheet-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sheet-body { min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
/* Comments sheet: the shared comments panel without its inline-card chrome. */
.sheet-comments .post-cm { margin: 0; padding: 0; border-top: 0; animation: none; flex: 1; min-height: 0; }
.sheet-comments .post-cm-list { overflow-y: auto; min-height: 60px; }
.sheet-comments .post-cm-form { flex: none; }
.sheet-comments .post-cm-form input { font-size: 16px; }
/* Composer sheet: the desktop composer, borderless, with a 150px text area. */
.sheet-composer { max-height: 92%; }
.sheet-composer .sheet-body { overflow: visible; }
.sheet-composer .composer,
.sheet-composer .composer.composer-open { margin: 0; padding: 0; background: transparent; box-shadow: none; }
.sheet-composer .composer textarea,
.sheet-composer .composer.composer-open textarea { height: 150px; font-size: 16px; }
.sheet-composer .composer-bar { flex-wrap: wrap; }
.sheet-composer .composer-kbd { display: none; }
/* The popover anchors to the whole composer (not the emoji button) so it fits a phone: full width, just above the toolbar. */
.sheet-composer .composer-emoji-wrap { position: static; }
.sheet-composer .composer-emoji { left: 0; right: 0; width: auto; top: auto; bottom: 64px; }
.sheet-composer .composer-att.composer-att-indent { margin-left: 0; }
@media (prefers-reduced-motion: reduce) {
.sheet, .sheet-bg { animation: none !important; }
}