WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.36k stars 4.13k forks source link

Tracking: fluid typography #44888

Closed ramonjd closed 7 months ago

ramonjd commented 1 year ago

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

eric-michel commented 1 year ago

@ramonjd I have a quick question regarding https://github.com/WordPress/gutenberg/pull/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 commented 1 year ago

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 commented 1 year ago

Please integrate #53525 to section "Wishlist"

briceduclos commented 1 year ago

@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 commented 1 year ago

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 commented 8 months ago

Wanted to note adding this to the mix: https://github.com/WordPress/gutenberg/issues/58135

ramonjd commented 7 months ago

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.