Skip to content

Typography: Switch font using inline span

This is the only solution I've been able to come up with for the problem described in #171, where the "Inter var" font is automatically replacing "1024x768" with "1024×768". It's admittedly pretty heavy-handed, but it works.

  • Add a custom role, 'unreplaced', to the .rst in order to insert an inline span around the 'x' in 1024x768.
  • Add custom CSS to style span.unreplaced as font-face: sans-serif.

IOW, the generated HTML for the table cell is:

1024<span class="unreplaced">x</span>768

And the CSS uses the "sans-serif" font, rather than "Inter var", inside the span.

Fixes #171

Merge request reports