Skip to content

Resolve text descender clipping in Firefox

What does this MR do and why?

Update height and line-height settings for navigation to prevent text descender clipping in Firefox. This approach relies on setting a height for the anchor and letting the text be displayed normally within instead of relying on line height and padding to determine the height.

Screenshots or screen recordings

📸 Expand screenshots
Before After
Firefox CleanShot_2023-01-04_at_11.32.09 CleanShot_2023-01-04_at_12.43.30
Firefox CleanShot_2023-01-04_at_12.46.31 CleanShot_2023-01-04_at_12.48.53
Arc (Chromium) (No visual change) CleanShot_2023-01-04_at_13.04.03 CleanShot_2023-01-04_at_13.02.16
Arc (Chromium) (No visual change) CleanShot_2023-01-04_at_13.05.07 CleanShot_2023-01-04_at_13.00.55
Height (Unchanged computed at 32px) CleanShot_2023-01-04_at_13.22.54_2x CleanShot_2023-01-04_at_13.22.32_2x

CleanShot_2023-01-04_at_13.21.15_2x

Codepen demo testing the technique →

How to set up and validate locally

Using Firefox and an additional browser (I used Arc which is Chromium):

  1. View left sidebar navigation in GDK (or review app) to confirm that:
    1. Descenders are not visibly cropped.
    2. Navigation item height remains unchanged (32px).
    3. Resizing text also resizes the nav item without cropped descenders.
  2. Collapsed state has no regression.
  3. Flyouts have no regression.
  4. Alpha dark mode has no regression (uses separate style sheet).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #386470 (closed)

Edited by Jeremy Elder

Merge request reports