Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-43638: Fix baseline mis-alignment for monospace inline text #47

Merged
merged 8 commits into from
May 2, 2024

Conversation

jonathansick
Copy link
Member

This PR addresses the baseline misalignment issue we're seeing on Safari with inline monospace text. Strategies:

  • Change fontsize on html element to 100% and make all font size decisions on the body and below
  • Decrease the size of the code monospace text slightly to just 1rem (body is 1.1 rem). This fixes the baseline misalignment.
  • Use ui-monspace generic font family for code, which gives us SF Mono on macOS.

New CSS properties:

  • --tn-component-text-font-size is 1.1rem by default and sets the font size on the body element.
  • --tn-component-code-font-family sets the font family for code and pre code blocks.

This will help us fix teh monospace font baseline alignment issue in
Safari.
Move setting the default font size to the body. This gives us slightly
bigger text while respecting the user stylesheet.

Also make the inline code font slightly smaller to help with baseline
alignment issues for inline monospace text seen in Safari.

Since the rem is now smaller, made the sizes in layout.scss use ems to
be relative to the size set on the body.
This is used for monospace fonts in code blocks and inline code. The
default is `ui-monospace`, which gives SF Mono on macOS.
@jonathansick jonathansick changed the title Tickets/DM-43638: Fix baseline mis-alignment for monospace inline text DM-43638: Fix baseline mis-alignment for monospace inline text May 1, 2024
This is used by the sphinx testing fixture, but isn't a dependency of
Sphinx itself, so we need to add it to our own dev dependencies.
I found that in pytest 8, running multiple builds for different test
roots with the sphinx text mark reused the same import of technote,
which in turn means that the metadata is not being rebuilt. This is fine
for normal sphinx builds where technote's technote.sphinxconf is being
imported only once, and therefore is dedicated to that single sphinx
build.

I think the solution is to make a new project builder for tests that
runs sphinx under a subprocess so that we can inspect the output at the
end.
And test with Python 3.12
@jonathansick jonathansick merged commit 99227d0 into main May 2, 2024
6 checks passed
@jonathansick jonathansick deleted the tickets/DM-43638 branch May 2, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant