<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[54825] branches/6.1/tests/phpunit/tests/block-supports/typography.php: Editor: Improve how `min`/`max` font sizes are calculated for fluid typography.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/54825">54825</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/54825","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>desrosj</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-11-11 17:54:23 +0000 (Fri, 11 Nov 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Editor: Improve how `min`/`max` font sizes are calculated for fluid typography.
- Where no fluid max values are set (e.g., single or custom font size values), the "size" value will act as the maximum value in a `clamp()` function.
- In the absence of any fluid `min`/`max` values, the lower bound rule of `>16px` will be enforced. This applies to custom values from the editor or single-value `theme.json` styles. Font sizes below this will not be clamped.
- In a preset, if a `fluid.min` value has been specified, the lower bound rule of `>16px` won't be enforced on this value. Presets with a fluid object therefore, give precedence to theme author's values.
- In a preset, if there is NOT a `fluid.max` but there is `fluid.min`, use the incoming "size" value as the `max`.
- In a preset, if there is NOT a `fluid.min` but there is a `fluid.max`, use `size * min_size_factor` as the `min`. The lower bound rule of `>16px` is enforced here, because the block editor is computing the `min` value. This is consistent with the way minimum sizes are calculated for single or custom values.
Props ramonopoly, mamaduka, andrewserong, aristath, joen, desrosj.
Merges <a href="https://core.trac.wordpress.org/changeset/54823">[54823]</a> to the 6.1 branch.
Fixes <a href="https://core.trac.wordpress.org/ticket/57075">#57075</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches61srcwpincludesblocksupportstypographyphp">branches/6.1/src/wp-includes/block-supports/typography.php</a></li>
<li><a href="#branches61testsphpunittestsblocksupportstypographyphp">branches/6.1/tests/phpunit/tests/block-supports/typography.php</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#branches61">branches/6.1/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: branches/6.1
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/6.1 2022-11-11 17:49:28 UTC (rev 54824)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/6.1 2022-11-11 17:54:23 UTC (rev 54825)
</ins><a id="branches61"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/6.1</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/5.0:43681-43682,43684-43688,43719-43720,43723,43726-43727,43729-43731,43734-43744,43747,43751-43754,43758,43760-43765,43767-43770,43772,43774-43781,43783,43785,43790-43806,43808-43821,43825,43828,43830-43834,43836-43843,43846-43863,43867-43889,43891-43894,43897-43905,43908-43909,43911-43929,43931-43942,43946-43947,43949-43956,43959-43964,43967-43969,43988,43994,44014,44017,44047,44183,44185,44187-44206,44208-44213,44231-44232,44235,44248,44284,44287-44288
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/5.5:49373-49379,49381
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/5.8:51889
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/trunk:54645-54646,54649,54652,54660,54662,54669,54674,54678,54686,54690,54693,54698,54706,54724,54729-54730,54733,54741,54745,54751,54766,54768-54771,54774,54777,54782,54785-54789,54797,54799,54801-54804,54811,54813,54815,54817,54819,54821
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/trunk:54645-54646,54649,54652,54660,54662,54669,54674,54678,54686,54690,54693,54698,54706,54724,54729-54730,54733,54741,54745,54751,54766,54768-54771,54774,54777,54782,54785-54789,54797,54799,54801-54804,54811,54813,54815,54817,54819,54821,54823
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches61srcwpincludesblocksupportstypographyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/6.1/src/wp-includes/block-supports/typography.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/6.1/src/wp-includes/block-supports/typography.php 2022-11-11 17:49:28 UTC (rev 54824)
+++ branches/6.1/src/wp-includes/block-supports/typography.php 2022-11-11 17:54:23 UTC (rev 54825)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -452,6 +452,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * formula depending on available, valid values.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 6.1.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.1.1 Adjusted rules for min and max font sizes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $preset {
</span><span class="cx" style="display: block; padding: 0 10px"> * Required. fontSizes preset value as seen in theme.json.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -489,7 +490,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $default_maximum_viewport_width = '1600px';
</span><span class="cx" style="display: block; padding: 0 10px"> $default_minimum_viewport_width = '768px';
</span><span class="cx" style="display: block; padding: 0 10px"> $default_minimum_font_size_factor = 0.75;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $default_maximum_font_size_factor = 1.5;
</del><span class="cx" style="display: block; padding: 0 10px"> $default_scale_factor = 1;
</span><span class="cx" style="display: block; padding: 0 10px"> $default_minimum_font_size_limit = '14px';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -508,22 +508,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Font sizes.
</span><span class="cx" style="display: block; padding: 0 10px"> $preferred_size = wp_get_typography_value_and_unit( $preset['size'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Protect against unsupported units.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Protects against unsupported units.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $preferred_size['unit'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $preset['size'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // If no fluid max font size is available, create one using max font size factor.
- if ( ! $maximum_font_size_raw ) {
- $maximum_font_size_raw = round( $preferred_size['value'] * $default_maximum_font_size_factor, 3 ) . $preferred_size['unit'];
- }
-
- // If no fluid min font size is available, create one using min font size factor.
- if ( ! $minimum_font_size_raw ) {
- $minimum_font_size_raw = round( $preferred_size['value'] * $default_minimum_font_size_factor, 3 ) . $preferred_size['unit'];
- }
-
- // Normalizes the minimum font size limit according to the incoming unit, so we can perform checks using it.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * Normalizes the minimum font size limit according to the incoming unit,
+ * in order to perform comparative checks.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $minimum_font_size_limit = wp_get_typography_value_and_unit(
</span><span class="cx" style="display: block; padding: 0 10px"> $default_minimum_font_size_limit,
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -531,29 +524,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $minimum_font_size_limit ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Don't enforce minimum font size if a font size has explicitly set a min and max value.
+ if ( ! empty( $minimum_font_size_limit ) && ( ! $minimum_font_size_raw && ! $maximum_font_size_raw ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * If a minimum size was not passed to this function
</span><span class="cx" style="display: block; padding: 0 10px"> * and the user-defined font size is lower than $minimum_font_size_limit,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * then use the user-defined font size as the minimum font-size.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * do not calculate a fluid value.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $fluid_font_size_settings['min'] ) && $preferred_size['value'] < $minimum_font_size_limit['value'] ) {
- $minimum_font_size_raw = implode( '', $preferred_size );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $preferred_size['value'] <= $minimum_font_size_limit['value'] ) {
+ return $preset['size'];
+ }
+ }
+
+ // If no fluid max font size is available use the incoming value.
+ if ( ! $maximum_font_size_raw ) {
+ $maximum_font_size_raw = $preferred_size['value'] . $preferred_size['unit'];
+ }
+
+ /*
+ * If no minimumFontSize is provided, create one using
+ * the given font size multiplied by the min font size scale factor.
+ */
+ if ( ! $minimum_font_size_raw ) {
+ $calculated_minimum_font_size = round(
+ $preferred_size['value'] * $default_minimum_font_size_factor,
+ 3
+ );
+
+ // Only use calculated min font size if it's > $minimum_font_size_limit value.
+ if ( ! empty( $minimum_font_size_limit ) && $calculated_minimum_font_size <= $minimum_font_size_limit['value'] ) {
+ $minimum_font_size_raw = $minimum_font_size_limit['value'] . $minimum_font_size_limit['unit'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $minimum_font_size_parsed = wp_get_typography_value_and_unit(
- $minimum_font_size_raw,
- array(
- 'coerce_to' => $preferred_size['unit'],
- )
- );
-
- /*
- * If the passed or calculated minimum font size is lower than $minimum_font_size_limit
- * use $minimum_font_size_limit instead.
- */
- if ( ! empty( $minimum_font_size_parsed ) && $minimum_font_size_parsed['value'] < $minimum_font_size_limit['value'] ) {
- $minimum_font_size_raw = implode( '', $minimum_font_size_limit );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $minimum_font_size_raw = $calculated_minimum_font_size . $preferred_size['unit'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="branches61testsphpunittestsblocksupportstypographyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/6.1/tests/phpunit/tests/block-supports/typography.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/6.1/tests/phpunit/tests/block-supports/typography.php 2022-11-11 17:49:28 UTC (rev 54824)
+++ branches/6.1/tests/phpunit/tests/block-supports/typography.php 2022-11-11 17:54:23 UTC (rev 54825)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,6 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests generating font size values, including fluid formulae, from fontSizes preset.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 56467
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 57065
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_get_typography_font_size_value
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,7 +321,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function data_generate_font_size_preset_fixtures() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default_return_value' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value when fluid typography is deactivated' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -328,7 +329,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'size: int 0' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value where font size is 0' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,7 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'size: string 0' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "returns value where font size is '0'" => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '0',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -344,7 +345,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => '0',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default_return_value_when_size_is_undefined' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value where `size` is `null`' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -352,7 +353,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default_return_value_when_fluid_is_false' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value when fluid is `false`' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -361,7 +362,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default_return_value_when_value_is_already_clamped' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns already clamped value' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -370,7 +371,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default_return_value_with_unsupported_unit' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value with unsupported unit' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '1000%',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => false,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -379,57 +380,65 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => '1000%',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_fluid_value' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value with rem min and max units' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '1.75rem',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(1.313rem, 1.313rem + ((1vw - 0.48rem) * 2.523), 2.625rem)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(1.313rem, 1.313rem + ((1vw - 0.48rem) * 0.84), 1.75rem)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_fluid_value_with_floats_with_units' => array(
- 'font_size_preset' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value with em min and max units' => array(
+ 'font_size' => array(
+ 'size' => '1.75em',
+ ),
+ 'should_use_fluid_typography' => true,
+ 'expected_output' => 'clamp(1.313em, 1.313rem + ((1vw - 0.48em) * 0.84), 1.75em)',
+ ),
+
+ 'returns clamp value for floats' => array(
+ 'font_size' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'size' => '100.175px',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(75.131px, 4.696rem + ((1vw - 7.68px) * 9.03), 150.263px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(75.131px, 4.696rem + ((1vw - 7.68px) * 3.01), 100.175px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_fluid_value_with_integer_coerced_to_px' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'coerces integer to `px` and returns clamp value' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => 33,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(24.75px, 1.547rem + ((1vw - 7.68px) * 2.975), 49.5px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(24.75px, 1.547rem + ((1vw - 7.68px) * 0.992), 33px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_fluid_value_with_float_coerced_to_px' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'coerces float to `px` and returns clamp value' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => 100.23,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(75.173px, 4.698rem + ((1vw - 7.68px) * 9.035), 150.345px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(75.173px, 4.698rem + ((1vw - 7.68px) * 3.012), 100.23px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_default_fluid_values_with_empty_fluid_array' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value when `fluid` is empty array' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 0.841), 28px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_default_fluid_values_with_null_value' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value when `fluid` is `null`' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 2.524), 42px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 0.841), 28px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_clamped_value_if_min_font_size_is_greater_than_max' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value if min font size is greater than max' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '3rem',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -441,7 +450,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => 'clamp(5rem, 5rem + ((1vw - 0.48rem) * -5.769), 32px)',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_size_with_invalid_fluid_units' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value with invalid min/max fluid units' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '10em',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -453,15 +462,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => '10em',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_clamped_size_where_no_min_is_given_and_less_than_default_min_size' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value when size is < lower bounds and no fluid min/max set' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '3px',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(3px, 0.188rem + ((1vw - 7.68px) * 0.18), 4.5px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => '3px',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_fluid_clamp_value_with_different_min_max_units' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns value when size is equal to lower bounds and no fluid min/max set' => array(
+ 'font_size' => array(
+ 'size' => '14px',
+ ),
+ 'should_use_fluid_typography' => true,
+ 'expected_output' => '14px',
+ ),
+
+ 'returns clamp value with different min max units' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -473,7 +490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => 'clamp(20px, 1.25rem + ((1vw - 7.68px) * 93.75), 50rem)',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'return_clamp_value_with_default_fluid_max_value' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value where no fluid max size is set' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,10 +498,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(2.6rem, 2.6rem + ((1vw - 0.48rem) * 0.048), 42px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(2.6rem, 2.6rem + ((1vw - 0.48rem) * -1.635), 28px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default_return_clamp_value_with_default_fluid_min_value' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value where no fluid min size is set' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => '28px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -495,32 +512,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected_output' => 'clamp(21px, 1.313rem + ((1vw - 7.68px) * 7.091), 80px)',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'should_adjust_computed_min_in_px_to_min_limit' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'should not apply lower bound test when fluid values are set' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'size' => '14px',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'size' => '1.5rem',
+ 'fluid' => array(
+ 'min' => '0.5rem',
+ 'max' => '5rem',
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(14px, 0.875rem + ((1vw - 7.68px) * 0.841), 21px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(0.5rem, 0.5rem + ((1vw - 0.48rem) * 8.654), 5rem)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'should_adjust_computed_min_in_rem_to_min_limit' => array(
- 'font_size_preset' => array(
- 'size' => '1.1rem',
- ),
- 'should_use_fluid_typography' => true,
- 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 1.49), 1.65rem)',
- ),
-
- 'default_return_clamp_value_with_replaced_fluid_min_value_in_em' => array(
- 'font_size_preset' => array(
- 'size' => '1.1em',
- ),
- 'should_use_fluid_typography' => true,
- 'expected_output' => 'clamp(0.875em, 0.875rem + ((1vw - 0.48em) * 1.49), 1.65em)',
- ),
-
- 'should_adjust_fluid_min_value_in_px_to_min_limit' => array(
- 'font_size_preset' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'should not apply lower bound test when only fluid min is set' => array(
+ 'font_size' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'size' => '20px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'min' => '12px',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -527,34 +532,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(14px, 0.875rem + ((1vw - 7.68px) * 1.923), 30px)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(12px, 0.75rem + ((1vw - 7.68px) * 0.962), 20px)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'should_adjust_fluid_min_value_in_rem_to_min_limit' => array(
- 'font_size_preset' => array(
- 'size' => '1.5rem',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'should not apply lower bound test when only fluid max is set' => array(
+ 'font_size' => array(
+ 'size' => '0.875rem',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'min' => '0.5rem',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'max' => '20rem',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 2.644), 2.25rem)',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 36.779), 20rem)',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'should_adjust_fluid_min_value_but_honor_max_value' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'returns clamp value when min and max font sizes are equal' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'font_size_preset' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'size' => '1.5rem',
- 'fluid' => array(
- 'min' => '0.5rem',
- 'max' => '5rem',
- ),
- ),
- 'should_use_fluid_typography' => true,
- 'expected_output' => 'clamp(0.875rem, 0.875rem + ((1vw - 0.48rem) * 7.933), 5rem)',
- ),
-
- 'should_return_fluid_value_when_min_and_max_font_sizes_are_equal' => array(
- 'font_size_preset' => array(
</del><span class="cx" style="display: block; padding: 0 10px"> 'size' => '4rem',
</span><span class="cx" style="display: block; padding: 0 10px"> 'fluid' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'min' => '30px',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -573,6 +566,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * when "settings.typography.fluid" is set to true.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 56467
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 57065
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_register_typography_support
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -637,7 +631,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'return_value_with_fluid_typography' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'font_size_value' => '50px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => 'font-size:clamp(37.5px, 2.344rem + ((1vw - 7.68px) * 4.507), 75px);',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => 'font-size:clamp(37.5px, 2.344rem + ((1vw - 7.68px) * 1.502), 50px);',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -648,6 +642,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * and the correct block content is generated.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 56467
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @ticket 57065
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_generate_replace_inline_font_styles_with_fluid_values_fixtures
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -695,7 +690,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'block_content' => '<h2 class="has-vivid-red-background-color has-background has-link-color" style="margin-top:var(--wp--preset--spacing--60);font-size:4rem;font-style:normal;font-weight:600;letter-spacing:29px;text-decoration:underline;text-transform:capitalize">This is a heading</h2>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'font_size_value' => '4rem',
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => '<h2 class="has-vivid-red-background-color has-background has-link-color" style="margin-top:var(--wp--preset--spacing--60);font-size:clamp(3rem, 3rem + ((1vw - 0.48rem) * 5.769), 6rem);font-style:normal;font-weight:600;letter-spacing:29px;text-decoration:underline;text-transform:capitalize">This is a heading</h2>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => '<h2 class="has-vivid-red-background-color has-background has-link-color" style="margin-top:var(--wp--preset--spacing--60);font-size:clamp(3rem, 3rem + ((1vw - 0.48rem) * 1.923), 4rem);font-style:normal;font-weight:600;letter-spacing:29px;text-decoration:underline;text-transform:capitalize">This is a heading</h2>',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'return_content_if_no_inline_font_size_found' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'block_content' => '<p class="has-medium-font-size" style="font-style:normal;font-weight:600;letter-spacing:29px;">A paragraph inside a group</p>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -713,13 +708,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'block_content' => '<p class="has-medium-font-size" style=" font-size: 20px ; ">A paragraph inside a group</p>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'font_size_value' => '20px',
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => '<p class="has-medium-font-size" style=" font-size:clamp(15px, 0.938rem + ((1vw - 7.68px) * 1.803), 30px); ">A paragraph inside a group</p>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => '<p class="has-medium-font-size" style=" font-size:clamp(15px, 0.938rem + ((1vw - 7.68px) * 0.601), 20px); ">A paragraph inside a group</p>',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'return_content_with_first_match_replace_only' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'block_content' => "<div class=\"wp-block-group\" style=\"font-size:1.5em\"> \n \n<p style=\"font-size:1.5em\">A paragraph inside a group</p></div>",
</span><span class="cx" style="display: block; padding: 0 10px"> 'font_size_value' => '1.5em',
</span><span class="cx" style="display: block; padding: 0 10px"> 'should_use_fluid_typography' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'expected_output' => "<div class=\"wp-block-group\" style=\"font-size:clamp(1.125em, 1.125rem + ((1vw - 0.48em) * 2.163), 2.25em);\"> \n \n<p style=\"font-size:1.5em\">A paragraph inside a group</p></div>",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'expected_output' => "<div class=\"wp-block-group\" style=\"font-size:clamp(1.125em, 1.125rem + ((1vw - 0.48em) * 0.721), 1.5em);\"> \n \n<p style=\"font-size:1.5em\">A paragraph inside a group</p></div>",
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>