Handling of fonts and sizes
Status
Accepted.
Context
ADR 0016 decided that POLAR uses KERN.
KERN specifies Fira Sans as its font, which raises multiple questions.
Should Fira Sans always be included, or only on demand?
- (+) We want to comply with KERN.
- (-) Users may want to deviate from it.
- (-) If the surrounding environment already provides
Fira Sans, it is loaded twice.
Additionally, it has to be decided which units are used for sizes and spacings.
Decision
Fira Sansis included by default, but can be switched off, e.g. to use the font of the surrounding environment or to avoid loading a font that is already present.- Sizes and spacings are expressed using the KERN variables for sizes and spacings and the KERN typography scale.
- Where there is a reason not to use the KERN variables, relative units are used, that is
reminstead ofpx, and%,emand similar where appropriate.
Consequences
- (+) POLAR complies with KERN out of the box, without further configuration.
- (+) Clients can adapt POLAR to the typography of the surrounding environment.
- (+) Duplicate loading of the font can be avoided.
- (+) Using relative units respects the font size configured by the user, which benefits accessibility.
- (o) The opt-out has to be documented for client developers.