Skip to content

First pass at improving reader mode styling

The following fonts are used for reader mode:

A copy of the fonts is included and used as Web fonts. The CSS rules are designed to match locally installed copies first, thus avoiding the need for WebKit to fetch them from the bundled resources when available in the system. The fonts are distributed under the terms of the SIL Open Font License.

On addition to the existing styling, a dark variant is provided as well. Chosing the color scheme is achieved by setting the light or dark class in the <body> element. Whether to use the serif or sans-serif font variant is chosen similarly using the sans and serif CSS classes.

This adds two settings as well, which for now can be set using external tools like dconf Editor or the gsettings command line tool:

  • reader-font-style: Chooses between sans-serif and serif font.
  • reader-color-scheme: Chooses between light or dark background.

For the moment the settings are read only when reader mode is activated.


There are a few items missing from this MR (see #52 (closed) for details), so I will be updating it in a couple of days with the following:

  • Expose the settings in the preferences window.
  • Immediately apply the settings when they change.
  • Review the sizing of elements to make them relative to each other, using a modular scale.

Fixes #52 (closed)

Edited by Adrián Pérez de Castro

Merge request reports