Editor: add configurable viewport sizes for fluid typography.

Adds options to configure min and max viewport sizes for fluid typography in theme.json settings.

Props ramonopoly.
Fixes #59048.


git-svn-id: https://develop.svn.wordpress.org/trunk@56535 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Isabel Brison
2023-09-07 04:28:45 +00:00
parent 9f5dd61a6e
commit 362624176c
3 changed files with 20 additions and 9 deletions

View File

@@ -7,7 +7,9 @@
},
"typography": {
"fluid": {
"minFontSize": "16px"
"minFontSize": "16px",
"maxViewportWidth": "1200px",
"minViewportWidth": "640px"
}
}
}

View File

@@ -622,6 +622,7 @@ class Tests_Block_Supports_Typography extends WP_UnitTestCase {
* @ticket 57529
* @ticket 58522
* @ticket 58523
* @ticket 59048
*
* @covers ::wp_register_typography_support
*
@@ -692,7 +693,7 @@ class Tests_Block_Supports_Typography extends WP_UnitTestCase {
'returns clamp value using custom fluid config' => array(
'font_size_value' => '17px',
'theme_slug' => 'block-theme-child-with-fluid-typography-config',
'expected_output' => 'font-size:clamp(16px, 1rem + ((1vw - 3.2px) * 0.147), 17px);',
'expected_output' => 'font-size:clamp(16px, 1rem + ((1vw - 6.4px) * 0.179), 17px);',
),
'returns value when font size <= custom min font size bound' => array(
'font_size_value' => '15px',