chiark / gitweb /
Use "rem" to set the base font size in CSS
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 24 Oct 2025 13:04:53 +0000 (14:04 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 13 Jan 2026 21:55:10 +0000 (21:55 +0000)
This means that the font size will vary based on the user's selected
default font size even in the absence of zooming.

bedstead.css

index 446d1eadf2963767868072408d0a5c3a15feecad..73a416fbab39cb0c00fcd52a452c27dba1f1434c 100644 (file)
@@ -10,7 +10,7 @@
 /* Use Bedstead for everything. */
 body {
     font-family: Bedstead;
-    font-size: 20px;
+    font-size: 1.25rem; /* 20px for normal default font size of 16px. */
     font-synthesis: none;
     margin: 8px;
     margin-left: 32px;
@@ -85,7 +85,7 @@ input:not([type="image" i], [type="range" i], [type="checkbox" i],
  * be used instead.
  */
 .text-sample {
-    font-size: 50px;
+    font-size: 2.5em;
     /* These may be overridden by the @media rule below. */
     display: block;
     speak: never;