Did you know that you can set your TiddlyWiki font using the latest in accessibility CSS?
Simply go to $:/ControlPanel
> Appearance
> Theme Tweaks
> Settings
and set the following:
- Font size:
clamp(12px, 1.2vw + 0.5rem, 16px)
- Line height:
1.5
- Font size for tiddler body:
clamp(14px, 1.5vw + 0.5rem, 16px)
- Line height for tiddler body:
1.7
Basically, what clamp(12px, 1.2vw + 0.5rem, 16px)
is saying is to set the minimum font size to 12px
and the maximum to 16px
. Depending on the viewport, adjust the font sizes by 1.2vw + 0.5rem
. While for the content, it's clamp(14px, 1.5vw + 0.5rem, 16px)
, same as the default but the minimum font size is 14px
.
These are good settings for the following reasons:
- It is flexible to the viewport size
- It is small screen friendly, minimum font size of
14px
for the content while12px
for everything else - It is good for desktop and larger screens with a maximum of
16px
- The user can still zoom or set their own user font size
Why 14px
and 12px
?
12px
is the generally accepted hard size for minimum font legibility14px
is the recommended minimum font size for reading
Any smaller than these is generally hard for adults and senior citizens, and thus, not good for accessibility.
Why 16px
?
16px
is the most common default browser size and what we are used to when surfing the net. 18px
is also a good choice if one wants to give more larger font size for larger screens, but unfortunately for tablet devices, even a small one, they go by the maximum 18px
if in landscape mode.
Of course, if one wants to, it is possible to resolve this by adding viewport-based CSS, but that is beyond the scope of this blog post.
Line height
I found 1.5
is excellent for clamp(12px, 1.2vw + 0.5rem, 16px)
(UI elements) while 1.7
for clamp(14px, 1.5vw + 0.5rem, 16px)
(reading). This is a personal preference. However, do note that if you're writing using various scripts—Hangeul, Nihongo, Baybayin, Hebrew, Phoenician, Latin/Roman—the line height should match each script otherwise it she glyphs might cramp together and make it harder to read in small viewports or consume too much space in larger screens.
For example:
- Latin/Roman script:
1.5
is good as a minimum - Hangeul and Nihongo:
1.6
- Baybayin:
1.7
- Hebrew and Phoenician:
1.7
That's it for this quick, no-edit blog post!