fix: mobile drawer width, group dividers and sidebar form layout

- Drawer uses the M3 width (up to 360px) so the appearance picker fits;
  segmented buttons get equal widths and swatches no longer shrink.
- Dividers separate the drawer groups, so section headings no longer
  read as nav items.
- Sidebar forms in the drawer (e.g. activity filters) line up with the
  nav labels, fields stack under their label, checkbox rows align.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andreas Reinhold / reini
2026-10-05 11:28:25 +02:00
co-authored by Claude Opus 5.5
parent b6654f31e7
commit 0e9ce26a1a
2 changed files with 27 additions and 4 deletions
+4 -4
View File
@@ -501,12 +501,11 @@ html .table-generator td.selected-cell, html .table-generator td:hover { backgro
letter-spacing: var(--md-sys-typescale-label-medium-tracking); letter-spacing: var(--md-sys-typescale-label-medium-tracking);
} }
/* M3 segmented button */ /* M3 segmented button */
.nm-segmented { display: flex; margin-block-end: 12px; } .nm-segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-block-end: 12px; } /* equal segments */
.nm-segmented button { .nm-segmented button {
flex: 1;
border-radius: 0; border-radius: 0;
block-size: 32px; block-size: 32px;
padding-inline: 12px; padding-inline: 8px;
border: 1px solid var(--md-sys-color-outline); border: 1px solid var(--md-sys-color-outline);
background: transparent; background: transparent;
color: var(--md-sys-color-on-surface); color: var(--md-sys-color-on-surface);
@@ -519,8 +518,9 @@ html .table-generator td.selected-cell, html .table-generator td:hover { backgro
.nm-segmented button:hover { background-image: var(--nm-state-hover); } .nm-segmented button:hover { background-image: var(--nm-state-hover); }
.nm-segmented button[aria-pressed="true"] { background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); } .nm-segmented button[aria-pressed="true"] { background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
/* Color swatches: the selected one gets a ring */ /* Color swatches: the selected one gets a ring */
.nm-swatches { display: flex; gap: 8px; } .nm-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.nm-swatch { .nm-swatch {
flex-shrink: 0;
inline-size: 28px; inline-size: 28px;
block-size: 28px; block-size: 28px;
padding: 0; padding: 0;
+23
View File
@@ -51,8 +51,11 @@
which core's responsive.js already binds to close the flyout. */ which core's responsive.js already binds to close the flyout. */
html.flyout-is-active :is(#wrapper, #header) { inset-inline-end: 0; } html.flyout-is-active :is(#wrapper, #header) { inset-inline-end: 0; }
html .flyout-menu { html .flyout-menu {
--nm-drawer-width: min(360px, calc(100vw - 56px)); /* M3 modal drawer; core's 250px squeezes the appearance picker */
position: fixed; position: fixed;
inset-block: 0; inset-block: 0;
inset-inline-end: calc(-1 * var(--nm-drawer-width));
inline-size: var(--nm-drawer-width);
z-index: 10001; /* over core's fixed header (9999) and the scrim */ z-index: 10001; /* over core's fixed header (9999) and the scrim */
block-size: auto; block-size: auto;
overflow-y: auto; overflow-y: auto;
@@ -86,6 +89,26 @@
letter-spacing: var(--md-sys-typescale-title-small-tracking); letter-spacing: var(--md-sys-typescale-title-small-tracking);
text-transform: none; text-transform: none;
} }
/* M3 drawer dividers between groups; headings alone look like one more nav item */
html .flyout-menu > :is(h3, .flyout-menu__sidebar:has(#sidebar-wrapper > *), .nm-appearance) {
display: block; /* the sidebar group is a span */
margin-block-start: 8px;
padding-block-start: 8px;
border-block-start: 1px solid var(--md-sys-color-outline-variant);
}
html .flyout-menu > h3 { padding-block-start: 16px; }
/* Sidebar forms (e.g. activity filters) line up with the nav labels; a field stacks under
its label, which is a bare text node, so grid is the only way to put it on its own row */
html .flyout-menu__sidebar :is(form > p, li:has(> input[type="checkbox"])) { padding-inline: 16px; }
html .flyout-menu__sidebar p:has(> :is(select, input:not([type="submit"], [type="checkbox"], [type="radio"]))) {
display: grid;
gap: 4px;
color: var(--md-sys-color-on-surface-variant);
font: var(--md-sys-typescale-label-large);
}
html .flyout-menu__sidebar p > :is(select, input:not([type="submit"], [type="checkbox"], [type="radio"])) { inline-size: 100%; box-sizing: border-box; }
html .flyout-menu__sidebar li:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 12px; min-block-size: 40px; border: 0; }
html .flyout-menu .flyout-menu__sidebar li:has(> input[type="checkbox"]) a { block-size: auto; padding: 0; line-height: inherit; }
html .flyout-menu h4 { color: var(--md-sys-color-on-surface); } html .flyout-menu h4 { color: var(--md-sys-color-on-surface); }
html .flyout-menu a { color: var(--md-sys-color-on-surface-variant); } html .flyout-menu a { color: var(--md-sys-color-on-surface-variant); }
html .flyout-menu ul li a, html .flyout-menu ul li:first-child a { html .flyout-menu ul li a, html .flyout-menu ul li:first-child a {