-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook.css
More file actions
32 lines (29 loc) · 1.34 KB
/
Copy pathbook.css
File metadata and controls
32 lines (29 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Quarto auto-numbers each book chapter, so the page title renders as
<span class="chapter-number">1</span> <span class="chapter-title">…</span>
The bare "1" is redundant with our Part/Module grouping, so we hide it — but
hiding the number span alone leaves the " " text node that followed it
as leading whitespace before the title. We collapse that whitespace by
zeroing the h1's font size and restoring the visible title span.
Scope notes:
- .chapter-number is hidden globally (page title AND sidebar).
- The font-size:0 collapse is scoped with :has(.chapter-number) so it only
touches chapter titles — the landing page's <h1 class="title"> holds raw
text (no .chapter-title span) and must not be zeroed.
- The restore is scoped to `h1.title .chapter-title`, so sidebar chapter
links (which use .chapter-title outside any h1.title) are untouched.
- Section numbers (.header-section-number, e.g. 1.2.8) are left intact. */
.chapter-number {
display: none;
}
h1.title:has(.chapter-number) {
font-size: 0; /* collapses the dangling " " left by the hidden number */
}
/* Restore Bootstrap/cosmo's responsive h1 size on the visible title text. */
h1.title .chapter-title {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h1.title .chapter-title {
font-size: 2rem;
}
}