Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluid typography: use logarithmic scale factor to calculate a min font size #4605

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jun 13, 2023

Introduces logarithmic scale factor to calculate a minimum font scale that tapers out as the font size increases.

Added to the Gutenberg plugin in WordPress/gutenberg#49707

If #4604 is merged first, this PR will need a rebase and possibly the tests updated PR rebased now that #4604 has been merged.

Trac ticket: https://core.trac.wordpress.org/ticket/58523

Testing

I've tested this using the 2023 theme. Apply various custom and preset font sizes to headings and text. This PR will affect frontend font sizes only.

See WordPress/gutenberg#49707 for full test instructions.

npm run test:php -- --filter Tests_Block_Supports_Typography


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ramonjd ramonjd force-pushed the add/typography-fluid-font-size-logarithmic branch from 90e6598 to e971725 Compare June 20, 2023 05:39
Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good! Given npm packages aren't updated yet, the editor values don't match the front end but I do notice different values between trunk and this PR, and particularly the larger font sizes in this PR are displaying smaller and look more harmonious than on trunk.

@tellthemachines
Copy link
Contributor

Committed in r55947 / 787de79.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants