mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Editor: Don't use fluid layout value in typography.
Changes fluid typography calculation to use fallback value if layout wide size is a fluid value. Props ramonopoly, mukesh27, jastos, aurooba. See #58754. git-svn-id: https://develop.svn.wordpress.org/trunk@56503 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3c98d25402
commit
0b40c80d0d
@ -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;
|
||||
|
||||
@ -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
|
||||
*/
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 2,
|
||||
"settings": {
|
||||
"appearanceTools": true,
|
||||
"layout": {
|
||||
"wideSize": "clamp(1000px, 85vw, 2000px)"
|
||||
},
|
||||
"typography": {
|
||||
"fluid": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -699,6 +699,11 @@ class Tests_Block_Supports_Typography extends WP_UnitTestCase {
|
||||
'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);',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -179,6 +179,7 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
|
||||
'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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user