Skip to content

Commit

Permalink
Added style engine changes from WordPress/gutenberg#46566
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jun 21, 2023
1 parent 3380152 commit 6218f53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/wp-includes/style-engine/class-wp-style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @access private
* @since 6.1.0
* @since 6.3.0 Added support for text-columns.
*/
#[AllowDynamicProperties]
final class WP_Style_Engine {
Expand Down Expand Up @@ -217,6 +218,12 @@ final class WP_Style_Engine {
),
'path' => array( 'typography', 'lineHeight' ),
),
'textColumns' => array(
'property_keys' => array(
'default' => 'column-count',
),
'path' => array( 'typography', 'textColumns' ),
),
'textDecoration' => array(
'property_keys' => array(
'default' => 'text-decoration',
Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/tests/style-engine/styleEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function tear_down() {
* Tests generating block styles and classnames based on various manifestations of the $block_styles argument.
*
* @ticket 56467
* @ticket 58549
*
* @covers ::wp_style_engine_get_styles
*
Expand Down Expand Up @@ -189,14 +190,15 @@ public function data_wp_style_engine_get_styles() {
'fontStyle' => 'italic',
'fontWeight' => '800',
'lineHeight' => '1.3',
'textColumns' => '2',
'textDecoration' => 'underline',
'textTransform' => 'uppercase',
'letterSpacing' => '2',
),
),
'options' => null,
'expected_output' => array(
'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;text-decoration:underline;text-transform:uppercase;letter-spacing:2;',
'css' => 'font-size:clamp(2em, 2vw, 4em);font-family:Roboto,Oxygen-Sans,Ubuntu,sans-serif;font-style:italic;font-weight:800;line-height:1.3;column-count:2;text-decoration:underline;text-transform:uppercase;letter-spacing:2;',
'declarations' => array(
'font-size' => 'clamp(2em, 2vw, 4em)',
'font-family' => 'Roboto,Oxygen-Sans,Ubuntu,sans-serif',
Expand Down

0 comments on commit 6218f53

Please sign in to comment.