Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-includes/block-supports/typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function wp_get_typography_font_size_value( $preset, $should_use_fluid_typograph
: array();

// Defaults.
$default_maximum_viewport_width = isset( $layout_settings['wideSize'] ) ? $layout_settings['wideSize'] : '1600px';
$default_maximum_viewport_width = isset( $layout_settings['wideSize'] ) && ! empty( wp_get_typography_value_and_unit( $layout_settings['wideSize'] ) ) ? $layout_settings['wideSize'] : '1600px';
$default_minimum_viewport_width = '320px';
$default_minimum_font_size_factor_max = 0.75;
$default_minimum_font_size_factor_min = 0.25;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Theme Name: Block Theme Child Theme With Fluid Layout
Theme URI: https://wordpress.org/
Description: For testing purposes only.
Template: block-theme
Version: 1.0.0
Text Domain: block-theme-child-with-fluid-layout
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 2,
"settings": {
"appearanceTools": true,
"layout": {
"wideSize": "clamp(1000px, 85vw, 2000px)"
},
"typography": {
"fluid": true
}
}
}
5 changes: 5 additions & 0 deletions tests/phpunit/tests/block-supports/typography.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,11 @@ public function data_generate_block_supports_font_size_fixtures() {
'theme_slug' => 'block-theme-child-with-fluid-typography-config',
'expected_output' => 'font-size:15px;',
),
'returns clamp value using default config if layout is fluid' => array(
'font_size_value' => '15px',
'theme_slug' => 'block-theme-child-with-fluid-layout',
'expected_output' => 'font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.078), 15px);',
),
);
}

Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/tests/theme/themeDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public function test_theme_list() {
'Block Theme',
'Block Theme Child Theme',
'Block Theme Child with no theme.json',
'Block Theme Child Theme With Fluid Layout',
'Block Theme Child Theme With Fluid Typography',
'Block Theme Child Theme With Fluid Typography Config',
'Block Theme Non Latin',
Expand Down