Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
rem
units with a CSS variable for annotator font sizes
Various annotator UI components use rem-based font sizes to try and make the annotator UI match the document. However various sites (eg. Stack Overflow, OpenStax) set the root font size to a value that results in the Hypothesis UI elements having unreadably small or excessively large text. Also for these sites the rem-size doesn't reflect the actual "default" font size of the page as perceived by the user. To resolve this, change the font sizes from using rem units to a value calculated from a `--hypothesis-font-size` CSS variable. This variable is set to match 1rem when that lies in a reasonable range (16-24px) but is clamped to lie within that range otherwise. In future we could change the way the reference point is computed to try and match the "default" font size on the page, if that is not 1rem. Fixes #4615
- Loading branch information