rnxcmkidd: Add the viewport-fit bento shell and a dev feed preview with fixtures
This commit is contained in:
@@ -0,0 +1,189 @@
|
||||
/* Signed-in shell (spec "Desktop and tablet layout", ADR 0001 sections 3 and 6).
|
||||
.app is the size container; .bento is its child, so container queries can
|
||||
style it. The page never scrolls: only the panels' own lists do. */
|
||||
|
||||
.app {
|
||||
container: app / inline-size;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
overflow: hidden;
|
||||
background: var(--bg);
|
||||
color: var(--ink);
|
||||
transition: background-color .45s, color .45s;
|
||||
}
|
||||
|
||||
/* Below 1001px the tablet and phone tasks own the layout. Until then the
|
||||
panels stack in one column that scrolls inside the app frame. */
|
||||
.bento {
|
||||
height: 100%;
|
||||
padding: 14px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.bento-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* 1001px to 1180px: three columns, narrower sides. */
|
||||
@container app (min-width: 1001px) {
|
||||
.bento {
|
||||
display: grid;
|
||||
grid-template-columns: 244px minmax(0, 1fr) 292px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.bento-col { height: 100%; }
|
||||
}
|
||||
|
||||
/* 1181px and wider. */
|
||||
@container app (min-width: 1181px) {
|
||||
.bento { grid-template-columns: 272px minmax(0, 1fr) 324px; }
|
||||
}
|
||||
|
||||
/* Panels ----------------------------------------------------------------- */
|
||||
|
||||
.tile {
|
||||
position: relative;
|
||||
min-height: 0;
|
||||
background: var(--tile);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-panel);
|
||||
box-shadow: var(--shadow-tile);
|
||||
transition: background-color .45s, border-color .45s;
|
||||
}
|
||||
|
||||
.panel { display: flex; flex-direction: column; }
|
||||
|
||||
.panel-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 18px 18px 12px;
|
||||
}
|
||||
.panel-head h2 { margin: 0; font-size: 21px; }
|
||||
|
||||
/* A list that scrolls inside its panel. */
|
||||
.panel-scroll {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: var(--line-2) transparent;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
/* Faded top and bottom edges on a scrolling list. The mask color is only an
|
||||
alpha source, it is never painted. */
|
||||
.fade-edges {
|
||||
-webkit-mask-image: linear-gradient(to bottom, transparent 0, black 16px, black calc(100% - 32px), transparent 100%);
|
||||
mask-image: linear-gradient(to bottom, transparent 0, black 16px, black calc(100% - 32px), transparent 100%);
|
||||
}
|
||||
|
||||
/* Which panels grow to fill their column. */
|
||||
.bento-left .expert-search { flex: 1 1 0; }
|
||||
.bento-center .feed { flex: 1 1 0; }
|
||||
.bento-right { justify-content: flex-start; }
|
||||
.bento-right .rail-featured { flex: 0 1 auto; max-height: 40%; }
|
||||
.bento-right .rail-trending { flex: 1 1 0; }
|
||||
|
||||
/* Panel contents keep their inner padding off the scroll edge. */
|
||||
.expert-search .search-form { margin: 0 14px; display: flex; flex-direction: column; }
|
||||
.expert-search .search-form input { width: 100%; }
|
||||
.expert-search .chips { padding: 0 14px; }
|
||||
.expert-search .search-results { padding: 12px 14px 24px; }
|
||||
.rail .rail-list { padding: 4px 14px 24px; }
|
||||
.feed .composer { margin: 0 14px 4px; }
|
||||
.feed .feed-list { display: flex; flex-direction: column; gap: 16px; padding: 16px 14px 32px; }
|
||||
|
||||
/* Single-column fallback (below 1001px): lists get a usable height. */
|
||||
@container app (max-width: 1000px) {
|
||||
.bento-col .panel { flex: 0 0 auto; }
|
||||
.bento-col .panel-scroll { flex: 0 0 auto; max-height: 70vh; }
|
||||
.bento-right .rail-featured { max-height: none; }
|
||||
}
|
||||
|
||||
/* Account panel ---------------------------------------------------------- */
|
||||
|
||||
.account { flex: none; }
|
||||
|
||||
.account-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 14px 12px 12px 16px;
|
||||
}
|
||||
.account-word { flex: 1; font-size: 15px; }
|
||||
|
||||
.account-theme {
|
||||
appearance: none;
|
||||
flex: none;
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: var(--r-ctl);
|
||||
background: transparent;
|
||||
color: var(--ink-2);
|
||||
cursor: pointer;
|
||||
transition: background-color .2s, color .2s, transform .15s;
|
||||
}
|
||||
.account-theme:hover { background: var(--tile-2); color: var(--ink); }
|
||||
.account-theme:active { transform: scale(.9); }
|
||||
.account-theme svg { width: 20px; height: 20px; }
|
||||
|
||||
.account-me {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin: 0 12px;
|
||||
padding: 12px;
|
||||
border-radius: 14px;
|
||||
background: var(--tile-2);
|
||||
}
|
||||
.account-me-text { display: flex; flex-direction: column; min-width: 0; }
|
||||
.account-me-text strong { font-size: 14px; }
|
||||
.account-me-text span {
|
||||
font-size: 12.5px;
|
||||
color: var(--ink-3);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.account-live {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 18px 16px;
|
||||
font-size: 12.5px;
|
||||
color: var(--ink-3);
|
||||
}
|
||||
.account-dot {
|
||||
flex: none;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
animation: account-ping 2.2s infinite;
|
||||
}
|
||||
@keyframes account-ping {
|
||||
0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent), transparent 45%); }
|
||||
70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent), transparent 100%); }
|
||||
100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent), transparent 100%); }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.account-dot { animation: none !important; }
|
||||
.panel-scroll { scroll-behavior: auto !important; }
|
||||
}
|
||||
+2
-34
@@ -9,12 +9,6 @@ input { font: inherit; padding: 12px; border: 1px solid var(--line-2); border-ra
|
||||
input:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
|
||||
button { font: inherit; font-weight: 500; margin-top: 16px; padding: 12px; border: 0; border-radius: 8px; background: var(--accent); color: white; cursor: pointer; }
|
||||
.error { margin: 0 0 4px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 8px; color: var(--danger); background: var(--accent-soft); font-size: 14px; }
|
||||
.shell header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--tile); border-bottom: 1px solid var(--line); }
|
||||
.shell header div { display: flex; flex-direction: column; font-size: 14px; }
|
||||
.shell header span { color: var(--ink-3); }
|
||||
.shell header { position: sticky; top: 0; z-index: 5; }
|
||||
.shell header button { margin: 0 0 0 auto; padding: 8px 14px; background: transparent; color: var(--ink); border: 1px solid var(--ink); }
|
||||
.feed { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
|
||||
.post { background: var(--tile); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
|
||||
.post-head { display: flex; align-items: center; gap: 12px; }
|
||||
.post-who { display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
|
||||
@@ -31,7 +25,7 @@ button { font: inherit; font-weight: 500; margin-top: 16px; padding: 12px; borde
|
||||
.feed-center { display: grid; place-items: center; padding: 16px; }
|
||||
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.new-posts { position: sticky; top: 68px; z-index: 4; align-self: center; margin: 0; padding: 8px 16px; border-radius: 999px; }
|
||||
.new-posts { position: sticky; top: 12px; z-index: 4; align-self: center; margin: 0; padding: 8px 16px; border-radius: 999px; }
|
||||
.sentinel { height: 1px; }
|
||||
.like-btn { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 8px; background: transparent; color: var(--ink-3); border-radius: 8px; font-size: 14px; font-weight: 400; }
|
||||
.like-btn:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
|
||||
@@ -77,16 +71,6 @@ button { font: inherit; font-weight: 500; margin-top: 16px; padding: 12px; borde
|
||||
.menu .menu-danger { color: var(--danger); }
|
||||
.menu-ask { font-size: 13px; color: var(--ink-3); padding: 4px 8px; }
|
||||
|
||||
/* 3-column signed-in layout: nav | feed | rails. Wraps on narrow widths. */
|
||||
.columns { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
|
||||
.col-left { flex: 0 0 180px; position: sticky; top: 72px; padding-top: 16px; }
|
||||
.col-left > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
|
||||
.col-left a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
|
||||
.col-left a[aria-current="page"] { background: var(--ink); color: var(--bg); }
|
||||
.col-center { flex: 1 1 400px; min-width: 0; }
|
||||
.col-center .feed { padding-left: 0; padding-right: 0; }
|
||||
.col-right { flex: 0 0 300px; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 20px; }
|
||||
.rail h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
|
||||
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
||||
.rail-card { background: var(--tile); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; gap: 10px; }
|
||||
.expert-card { align-items: center; }
|
||||
@@ -100,25 +84,9 @@ button { font: inherit; font-weight: 500; margin-top: 16px; padding: 12px; borde
|
||||
.minnect-question { margin: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.minnect-video { background: black; border-radius: 0; }
|
||||
.minnect-audio { width: 100%; height: 36px; }
|
||||
@media (max-width: 959px) {
|
||||
.col-left { flex: 1 1 100%; position: static; padding-top: 8px; }
|
||||
.col-left > ul { flex-direction: row; }
|
||||
.col-center { flex: 1 1 100%; order: 3; }
|
||||
.col-right { flex: 1 1 100%; order: 2; position: static; max-height: none; overflow: visible; padding-top: 0; }
|
||||
.col-right .rail-list { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
|
||||
.col-right .rail-card { flex: 0 0 260px; }
|
||||
}
|
||||
|
||||
/* Expert search + category chips (left column). Squared corners, monochrome + red. */
|
||||
.expert-search { margin-top: 16px; }
|
||||
.expert-search summary { font-weight: 700; font-size: 16px; cursor: pointer; padding: 4px 0; }
|
||||
.expert-search form { display: flex; flex-direction: column; }
|
||||
.expert-search input { border-radius: 0; width: 100%; }
|
||||
/* Category chips (Find experts panel). Squared corners, monochrome + red. */
|
||||
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
|
||||
.chip { margin: 0; padding: 6px 10px; border-radius: 0; background: transparent; color: var(--ink); border: 1px solid var(--ink); font-size: 13px; }
|
||||
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: white; }
|
||||
.search-results { margin-top: 12px; }
|
||||
.search-note { margin: 0; font-size: 14px; color: var(--ink-3); }
|
||||
@media (max-width: 959px) {
|
||||
.col-left .expert-search { flex-basis: 100%; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user