fix(typography): apply typography.sizes.base to the root font size#3331
Open
Vidminas wants to merge 1 commit into
Open
fix(typography): apply typography.sizes.base to the root font size#3331Vidminas wants to merge 1 commit into
Vidminas wants to merge 1 commit into
Conversation
The typography partial emits `--hb-font-size-base` from `typography.sizes.base`,
but no CSS consumed it, so the config option had no effect (a dead knob).
Consume it on the root element: `html { font-size: var(--hb-font-size-base,
1rem) }`. On the root element `rem` resolves to the initial font-size, so the
1rem default respects the user's browser preference and unset configs render
exactly as before; setting a value now scales the whole rem-based type scale.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
β Deploy Preview for academic-demo canceled.
|
Contributor
|
Wow, your first PR! Welcome to the community! π Thank you for this contribution to open source and open research. It makes a huge impact for the thousands of innovators building with Hugo Blox. If you're wondering about next steps, please read our Contributor Guide for coding standards, how to run the project locally, and how to get help. We hope this is just the start of your journey with us. Let's build the future together! Join us on Discord to connect with the team and community. Awesome work, we'll take a look soon! β¨ |
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.
The typography partial emits
--hb-font-size-basefromtypography.sizes.base, but no CSS consumed it, so the config option had no effect.π What type of change is this?
π― What is the purpose of this change?
typography.sizes.baseis a dead config knob: the typography partial emits it as the customproperty
--hb-font-size-base(functions/typography.html), andlayout-utilities.cssevendocuments it, but no CSS ever consumes it, so setting it does nothing.
Fix. Consume it on the root element in
framework/base.css:html { font-size: var(--hb-font-size-base, 1rem); }. On the root elementremresolves to theinitial font-size, so the
1remdefault respects the user's browser preference and any site thatdoesn't set the knob renders exactly as before. Setting it now scales the whole rem-based type
scale as intended.
Verified on the
academic-cvstarter: withtypography.sizes.base: "20px", the built page emits--hb-font-size-base: 20pxand the bundled_entry.csshtmlrule readsfont-size: var(--hb-font-size-base, 1rem); with the knob unset it falls back to1rem.πΈ Screenshots or Screencast (if applicable)
n/a β behaviour is only observable when the knob is set (root font-size scales).
βΉοΈ Documentation Check
(The setting is already documented; this simply makes it functional.)
π Contributor Agreement
Thank you for your contribution!