• Robert Knight's avatar
    Replace `rem` units with a CSS variable for annotator font sizes · d0b71a69
    Robert Knight authored
    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, but clamped to ensure that our UI text is always readable.
    
    Fixes https://github.com/hypothesis/client/issues/4615
    d0b71a69
annotator.scss 1.21 KB