|
180 | 180 | font-size: 0.55rem !important; |
181 | 181 | } |
182 | 182 | } |
| 183 | +/* ===== compact mode: hide gutters but allow mobile drawer ===== */ |
| 184 | +@media (max-width: 1024px) { |
| 185 | + /* default: no gutters */ |
| 186 | + .md-sidebar--secondary, |
| 187 | + .md-sidebar__scrollwrap { |
| 188 | + display: none !important; |
| 189 | + width: 0 !important; |
| 190 | + margin: 0 !important; |
| 191 | + padding: 0 !important; |
| 192 | + } |
| 193 | + |
| 194 | + /* keep primary sidebar off-canvas, not display:none */ |
| 195 | + .md-sidebar--primary { |
| 196 | + /* off-screen but present so it can animate in */ |
| 197 | + visibility: hidden !important; |
| 198 | + transform: translateX(-120%) !important; |
| 199 | + width: 0 !important; |
| 200 | + } |
| 201 | + |
| 202 | + /* content stays single-column */ |
| 203 | + .md-main__inner { grid-template-columns: 1fr !important; } |
| 204 | + .md-content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; } |
| 205 | + |
| 206 | + /* when drawer is opened, re-enable and slide in the primary sidebar */ |
| 207 | + #__drawer:checked ~ .md-container .md-sidebar--primary, |
| 208 | + .md-sidebar--primary[data-md-state="active"] { |
| 209 | + display: block !important; /* ensure visible */ |
| 210 | + visibility: visible !important; |
| 211 | + transform: translateX(0) !important; /* slide in */ |
| 212 | + width: min(80vw, 20rem) !important; /* give it a real width */ |
| 213 | + max-width: 90vw !important; |
| 214 | + } |
| 215 | + |
| 216 | + /* its internal scroller must also be visible when open */ |
| 217 | + #__drawer:checked ~ .md-container .md-sidebar--primary .md-sidebar__scrollwrap, |
| 218 | + .md-sidebar--primary[data-md-state="active"] .md-sidebar__scrollwrap { |
| 219 | + display: block !important; |
| 220 | + width: 100% !important; |
| 221 | + } |
| 222 | +} |
0 commit comments