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

Tracking: fluid typography #44888

Closed
Tracked by #33447
ramonjd opened this issue Oct 12, 2022 · 7 comments
Closed
Tracked by #33447

Tracking: fluid typography #44888

ramonjd opened this issue Oct 12, 2022 · 7 comments
Assignees
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Typography Font and typography-related issues and PRs [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@ramonjd
Copy link
Member

ramonjd commented Oct 12, 2022

An overview issue to track fluid typography follow ups and enhancements.

Related:

Fluid typography base functionality

Current improvements, fixes and extensions

Wishlist

Bugs, tasks, and issues not covered here

For bug reports and smaller tasks, we can use the [Feature] Typography issue label for tracking and visibility.

Closed unfixed

@ramonjd ramonjd added [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Typography Font and typography-related issues and PRs labels Oct 12, 2022
@ramonjd ramonjd self-assigned this Apr 3, 2023
@eric-michel
Copy link

eric-michel commented Jul 27, 2023

@ramonjd I have a quick question regarding #49815.

Is there a way to independently specify the maximum viewport width for fluid font size calculations? The change in 49815 will significantly reduce the width at which our font sizes will begin shrinking, and could break certain layouts on legacy sites. Going forward, I definitely support using settings.layout.wideSize as the maximum viewport width, but I would like to keep 1600px as the max value for existing sites just to avoid any possible issues.

If this is something I can set in theme.json right now on those older sites in anticipation of this PR becoming active in WP core, that would be super helpful.

edit: Looking at the theme.json schema, I don't see a setting for this. I think it would be very useful to make both values (the max and the min) for the calculation independently customizable for those who wish to do so.

@ramonjd
Copy link
Member Author

ramonjd commented Jul 28, 2023

Thanks for the question @eric-michel

This is something I wanted to do much earlier on. See comment and commit history of:

You're right, it's not possible to configure at the moment, unless you fiddle with the layout width.

I think it should be possible for theme authors to configure both the min and the max in theme.json. I've added a PR here to remind myself to come back to it 😄

@porg
Copy link

porg commented Aug 10, 2023

Please integrate #53525 to section "Wishlist"

@briceduclos
Copy link

@ramonjd Are there any plans to add the minimum font size factor as a configurable option in theme.json?

$minimum_font_size_factor     = min( max( 1 - 0.075 * log( $preferred_font_size_in_px, 2 ), $default_minimum_font_size_factor_min ), $default_minimum_font_size_factor_max );
$calculated_minimum_font_size = round( $preferred_size['value'] * $minimum_font_size_factor, 3 );

The min and max viewport width configurable options are a great improvement. Adding the min size factor would offer precise control over the responsiveness of font sizes. For my website, the current factor makes the curve move towards the minimum too slowly at the beginning and too quickly at the end.

@ramonjd
Copy link
Member Author

ramonjd commented Aug 14, 2023

Are there any plans to add the minimum font size factor as a configurable option in theme.json?

Thanks for the ping.

Allowing more config options was something that I explored in a previous, now closed, PR..

scaleFactor is definitely something that may be useful to tweak as it controls how fast the font sizes change between min and max limits.

Another idea, and something I'd like to pursue, is leveraging filters to override some things.

It was decided to move slowly with this sort of stuff to provide room for more testing as every change as the potential to affect existing sites implementing the fluid font size system.

It's on the wishlist in the description of this tracking issue 👍🏻

@annezazu
Copy link
Contributor

Wanted to note adding this to the mix: #58135

@ramonjd
Copy link
Member Author

ramonjd commented Feb 23, 2024

I'm going to close this tracking PR, as the main feature has been implemented since WordPress 6.1.

Subsequent bugfixes and stability updates are complete.

The outstanding issues can stand on their own.

@ramonjd ramonjd closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Typography Font and typography-related issues and PRs [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

5 participants