chiark / gitweb /
Explicitly set font-weight to 500 in CSS
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 12 Dec 2025 14:29:39 +0000 (14:29 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 13 Jan 2026 21:55:10 +0000 (21:55 +0000)
Bedstead's standard weight is 500, reflecting the fact that it's
naturally quite heavy.  CSS defaults to 400, so we were depending on
CSS's font-matching rules to fall back from 400 to 500.  That's fine
at the moment, where there is no 400-weight version.  But Bedstead
could be made lighter, and indeed the code to do it already exists.
And I hope that somewhere in the future is a variable Bedstead that
might allow for lighter weights.  So for future-proofing I think the
CSS should specify the weight that it actually wants.  Obviously I can
update my CSS if I ever introduce a 400 weight, but other people might
reasonably use my CSS as an example and I shouldn't lead them into
trouble.

bedstead.css

index 73a416fbab39cb0c00fcd52a452c27dba1f1434c..bc2a29b95048f0f61af03790cb809a21bd0c8460 100644 (file)
@@ -12,6 +12,7 @@ body {
     font-family: Bedstead;
     font-size: 1.25rem; /* 20px for normal default font size of 16px. */
     font-synthesis: none;
+    font-weight: 500;
     margin: 8px;
     margin-left: 32px;
     max-width: 60em;