Skip to content

Commit c3b5540

Browse files
committed
docs: the page tree shares the page's plane, and is a left drawer on phones
The tree sat on surface-container-low behind a divider under a surface bar, so bar, tree and article read as three blocks. It is now the M3 standard drawer on surface with no divider, and under 840px the M3 modal drawer from the left over the bar, the mirror of the menu drawer, instead of a panel dropping out from under the bar. DESIGN.md's Navigation section records it. Signed-off-by: ravindu644 <droidcasts@protonmail.com>
1 parent 661336f commit c3b5540

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

‎DESIGN.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,11 @@ on `surface-container-low`, radius 16 on its open edge, no border, the scrim beh
536536
separating. Items are 56px tall at full radius, and the current page sits on `secondary-container`
537537
with `on-secondary-container` text, which is the drawer's active indicator.
538538

539+
The docs page tree is the M3 standard navigation drawer: 280px, on `surface` like the bar and the
540+
page, no divider. The section labels and the active pill are its only structure, so the bar, the
541+
tree and the article read as one plane. Under 840px it becomes a modal drawer from the left, the
542+
mirror of the menu drawer, opened from the breadcrumb row that stays under the bar.
543+
539544
### Phone mockup
540545

541546
One component, one silhouette, described under Shapes. It takes a screenshot. Phones do not

‎assets/css/main.css‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ html { scroll-padding-top: 80px; } /* an anchor lands below the 64px sticky nav,
9494
height: calc(100dvh - 64px);
9595
overflow-y: auto;
9696
overscroll-behavior: contain; /* scrolling the tree never scrolls the page behind it */
97-
border-right: 1px solid var(--md-sys-color-outline-variant);
97+
background: var(--md-sys-color-surface); /* the standard drawer shares the page's plane; no divider, the pill and labels do the structure */
9898
}
9999
.docs-content { padding: 48px 48px 96px; }
100100
}
@@ -103,7 +103,8 @@ html { scroll-padding-top: 80px; } /* an anchor lands below the 64px sticky nav,
103103
.toc-column { display: block; position: sticky; top: 64px; max-height: calc(100dvh - 64px); overflow-y: auto; padding: 48px 24px 32px 0; }
104104
}
105105
@media (max-width: 839px) {
106-
/* the page tree becomes a top drawer; the breadcrumb row is its handle and stays under the nav */
106+
/* the page tree becomes the M3 modal drawer from the left, the mirror of the menu drawer;
107+
the breadcrumb row is its handle and stays under the nav */
107108
.doc-breadcrumb {
108109
position: sticky;
109110
top: 64px;
@@ -116,7 +117,7 @@ html { scroll-padding-top: 80px; } /* an anchor lands below the 64px sticky nav,
116117
padding: 0 16px;
117118
border: 0;
118119
border-bottom: 1px solid var(--md-sys-color-outline-variant);
119-
background: var(--md-sys-color-surface-container-low);
120+
background: var(--md-sys-color-surface);
120121
color: var(--md-sys-color-on-surface-variant);
121122
font: inherit;
122123
font-size: 14px;
@@ -129,18 +130,18 @@ html { scroll-padding-top: 80px; } /* an anchor lands below the 64px sticky nav,
129130
.sidebar {
130131
display: none;
131132
position: fixed;
132-
inset: 64px 0 auto 0;
133-
width: 100%;
134-
max-height: calc(100dvh - 64px);
133+
inset: 0 auto 0 0;
134+
width: min(360px, 100%);
135+
height: 100dvh;
135136
overflow-y: auto;
136-
border-bottom: 1px solid var(--md-sys-color-outline-variant);
137-
translate: 0 -100%;
137+
border-radius: 0 var(--md-sys-shape-corner-lg) var(--md-sys-shape-corner-lg) 0;
138+
translate: -100% 0;
138139
transition: translate var(--motion-spatial-default), display var(--motion-spatial-default) allow-discrete, overlay var(--motion-spatial-default) allow-discrete;
139140
}
140141
.sidebar:popover-open { display: block; translate: 0 0; }
141-
@starting-style { .sidebar:popover-open { translate: 0 -100%; } }
142+
@starting-style { .sidebar:popover-open { translate: -100% 0; } }
142143
.sidebar::backdrop { background: color-mix(in srgb, transparent, var(--md-sys-color-surface-container-lowest) 38%); }
143-
.sidebar-close { display: inline-flex; position: absolute; top: 8px; right: 16px; }
144+
.sidebar-close { display: inline-flex; position: absolute; top: 16px; right: 12px; }
144145
.sidebar .search-open { width: calc(100% - 56px); } /* leaves room for the close button */
145146
}
146147

0 commit comments

Comments
 (0)