Repository navigation
fix: add explicit h5 heading styles to maintain size hierarchy - #381
Merged
Merged
Conversation
Contributor
Author
|
@jstac fix is inbound for the h5 heading issue. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #381 +/- ##
=======================================
Coverage ? 47.75%
=======================================
Files ? 2
Lines ? 423
Branches ? 0
=======================================
Hits ? 202
Misses ? 221
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
🎭 Visual Regression Test ResultsDetails
Skipped testsmobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling |
Contributor
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where
h5headings appeared visually larger thanh4headings, breaking the expected heading size hierarchy.Example: This was observed on pages like JAX Introduction where h5 sub-headings (e.g. "14.1.2.1.1. With NumPy") appeared as large as or larger than the h4 heading above them (e.g. "14.1.2.1. Speed!").
Root Cause
h5had no dedicated CSS rule in_base.scss. It only inherited from the general heading selector:Meanwhile,
h4was explicitly styled with:Two factors combined to make
h5appear larger thanh4:h5fell back to the browser default size rather than a size smaller thanh4's1.2rem.h5inherited "PT Serif" (a serif font with larger visual glyph metrics) whileh4used "Source Sans Pro" (a more compact sans-serif), amplifying the perceived size difference.Fix
Added an explicit
h5rule that maintains the descending heading hierarchy:Heading size hierarchy (after fix)