Skip to content

Commit 0420aff

Browse files
committed
fix(print): globally force-expand all <details> in print
nav, aside, and other interactive chrome are already suppressed by the print hide list, so scoping <details> expansion to .sf-prose was unnecessarily conservative. Any remaining <details> on a printed page is content that the reader needs to see. Remove the .sf-prose scope so all details elements have their content revealed and summary hidden. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016sHFkqd9bBBK3jN7faE9WV
1 parent fb4e3e5 commit 0420aff

3 files changed

Lines changed: 11 additions & 20 deletions

File tree

core/print.css

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,15 @@
112112
display: revert !important;
113113
}
114114

115-
/* Preserve <details> content regardless of open state — scoped to
116-
.sf-prose so collapsed navigation, dropdowns, and accordion menus
117-
outside prose regions are NOT force-expanded on paper. Only
118-
`summary` keeps `!important` — the disclosure chevron carries no
119-
print value and the consumer should not be able to bring it back
120-
inadvertently. The other two rules win against the UA stylesheet
121-
on layered-author > UA precedence alone. */
122-
.sf-prose details {
123-
display: block;
124-
}
125-
.sf-prose details > summary {
126-
display: none !important;
127-
}
128-
.sf-prose details > :not(summary) {
129-
display: block;
130-
}
115+
/* Preserve <details> content regardless of open state. nav, aside,
116+
and other interactive chrome are already hidden by the hide list
117+
above, so the remaining <details> are content — force them open.
118+
Only `summary` keeps `!important` — the disclosure chevron carries
119+
no print value and the consumer should not be able to bring it back
120+
inadvertently. */
121+
details { display: block; }
122+
details > summary { display: none !important; }
123+
details > :not(summary) { display: block; }
131124

132125
/* ── Opt-in colour treatment ─────────────────────────────────── */
133126

docs/api-index.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28577,8 +28577,7 @@
2857728577
"optional": false,
2857828578
"layer": "slashed.macros",
2857928579
"sourceFiles": [
28580-
"core/macros.css",
28581-
"core/print.css"
28580+
"core/macros.css"
2858228581
],
2858328582
"bundles": [
2858428583
"essential",

docs/classes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,9 @@ See [architecture.md](architecture.md) for layer order and naming conventions.
267267

268268
## Print utilities (`core/print.css`)
269269

270-
2 classes.
270+
1 classes.
271271

272272
| Class |
273273
|---|
274274
| `.sf-link-external` |
275-
| `.sf-prose` |
276275

0 commit comments

Comments
 (0)