Fluid font size application is dependent on the global state #58135
Labels
[Feature] Typography
Font and typography-related issues and PRs
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
I'm working with
WP_Theme_JSON
class. I feed it with a decode theme.json and use to generate styles I want to use in a custom editor.The issue is that even though I specify set
settings.typography.fluid
tofalse
and provide values in pixels the styles generated byWP_Theme_JSON::get_stylesheet
still contain the values converted toclamp
function.This seems to happen because
wp_get_typography_font_size_value
checks the global settings to see if the fluid font size is enabled. So if the site is configured to use the fluid font size it is always applied no matter what value I configure in data I pass toWP_Theme_JSON
.To add more context, my use case is a custom Gutenberg email editor, and I want to disable the fluid font size because
clamp
is not supported in many email clients.Step-by-step reproduction instructions
h1{font-size: clamp(27.894px, 1.743rem + ((1vw - 3.2px) * 2.285), 48px);}
but I would expect
h1{font-size: 48px;}
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: