Skip to content

Commit f7f95b7

Browse files
authored
Improve large screen layout and TOC positioning (#14)
1 parent cdc7aab commit f7f95b7

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

src/styles/custom.css

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,34 @@
1111
--sl-font-system: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
1212
--sl-font-mono: 'SF Mono', 'Fira Code', Monaco, Consolas, monospace;
1313

14-
/* Layout */
15-
--sl-content-width: 75ch;
16-
--sl-sidebar-width: 18rem;
17-
1814
/* Snap Scroll */
1915
--header-height: 4rem;
2016
}
2117

18+
/* ===== Large screen layout adjustments ===== */
19+
/* Widen content area on large screens */
20+
@media (min-width: 72rem) {
21+
:root {
22+
--sl-content-width: 52rem;
23+
}
24+
}
25+
26+
@media (min-width: 100rem) {
27+
:root {
28+
--sl-content-width: 58rem;
29+
}
30+
}
31+
32+
/* Pin TOC to the right edge of the screen */
33+
@media (min-width: 72rem) {
34+
.right-sidebar {
35+
inset-inline-end: 0;
36+
inset-inline-start: auto;
37+
/* Relies on Starlight's default --sl-sidebar-width; not redefined here to preserve core layout */
38+
width: var(--sl-sidebar-width);
39+
}
40+
}
41+
2242
/* Dark mode accent adjustments */
2343
:root[data-theme='dark'] {
2444
--sl-color-accent-low: #4338ca;

0 commit comments

Comments
 (0)