Skip to content

Commit ad946ee

Browse files
feat(web): adopt Gov.uk design patterns — typography + print button (#122)
Typography (Gov.uk accessibility research): - Line-height: 1.7 → 1.5 (Gov.uk uses 1.32, legal docs typically 1.5) - Mobile font: remove 16px override, keep 19px everywhere (Gov.uk finding: smaller mobile fonts hurt accessibility) Print button: - Add "Print" button to section metadata bar - Uses window.print() with existing print stylesheet - Legal researchers routinely print statute sections Based on Gov.uk Design System and legislation.gov.uk research. Consensus approved 2-0. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d174bdc commit ad946ee

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

apps/web/src/pages/statute/[...slug].astro

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ const readingTimeMin = Math.max(1, Math.round(wordCount / 200));
148148
>
149149
View on OLRC &rarr;
150150
</a>
151+
<button
152+
onclick="window.print()"
153+
class="rounded bg-gray-100 px-2 py-1 text-gray-600 hover:bg-gray-200 transition-colors dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700"
154+
aria-label="Print this section"
155+
>
156+
Print
157+
</button>
151158
</div>
152159
</div>
153160

apps/web/src/styles/global.css

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/* Legal text readability — 19px desktop, 16px mobile */
1717
.prose {
1818
font-size: 1.1875rem; /* 19px — optimal for legal text readability */
19-
line-height: 1.7; /* Wikipedia research: 1.4-1.7 optimal for reading speed + comprehension */
19+
line-height: 1.5; /* Gov.uk uses 1.32 (25/19px), legal docs use 1.5 — balances density + readability */
2020
max-width: min(72ch, 100%);
2121
}
2222

@@ -120,16 +120,11 @@
120120
border-color: var(--color-gray-700, #334155);
121121
}
122122

123-
/* Mobile prose — tighter width, smaller font, more spacing for thumb-scrolling */
123+
/* Mobile prose — tighter width, keep 19px font (Gov.uk accessibility: same size all screens) */
124124
@media (max-width: 768px) {
125125
.prose {
126-
font-size: 1rem; /* 16px on mobile */
127126
max-width: min(90vw, 65ch);
128127
}
129-
.prose p {
130-
margin-top: 1.5em;
131-
margin-bottom: 1.5em;
132-
}
133128
}
134129

135130
/* Sticky section headers on chapter pages — shows which section user is reading */

0 commit comments

Comments
 (0)