From 9448577fb7e2249433078fdab4ba2ac738eba5c2 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Tue, 14 Jun 2022 15:14:54 +0100 Subject: [PATCH] Simplify: remove transitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let’s tackle this in a separate PR --- lib/load.php | 8 -------- packages/style-engine/class-wp-style-engine.php | 8 -------- .../style-engine/phpunit/class-wp-style-engine-test.php | 9 +++------ 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/lib/load.php b/lib/load.php index aa67455551aee..3d6d782eae15b 100644 --- a/lib/load.php +++ b/lib/load.php @@ -151,14 +151,6 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/demo.php'; require __DIR__ . '/experiments-page.php'; -add_filter( - 'safe_style_css', - function( $safe_rules ) { - $safe_rules[] = 'transition'; - return $safe_rules; - } -); - // Copied package PHP files. if ( file_exists( __DIR__ . '/../build/style-engine/class-wp-style-engine-gutenberg.php' ) ) { require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-gutenberg.php'; diff --git a/packages/style-engine/class-wp-style-engine.php b/packages/style-engine/class-wp-style-engine.php index 7254157efa881..5bf2abbe3287a 100644 --- a/packages/style-engine/class-wp-style-engine.php +++ b/packages/style-engine/class-wp-style-engine.php @@ -144,14 +144,6 @@ class WP_Style_Engine { ), ), ), - 'effects' => array( - 'transition' => array( - 'property_keys' => array( - 'default' => 'transition', - ), - 'path' => array( 'effects', 'transition' ), - ), - ), 'elements' => array( 'link' => array( 'path' => array( 'elements', 'link' ), diff --git a/packages/style-engine/phpunit/class-wp-style-engine-test.php b/packages/style-engine/phpunit/class-wp-style-engine-test.php index 9878e02dc918f..fc7e1ee67be49 100644 --- a/packages/style-engine/phpunit/class-wp-style-engine-test.php +++ b/packages/style-engine/phpunit/class-wp-style-engine-test.php @@ -385,7 +385,7 @@ public function data_generate_styles_fixtures() { ), ), - 'elements_and_element_states_with_css_vars_and_transitions' => array( + 'elements_and_element_states_with_css_vars' => array( 'block_styles' => array( 'elements' => array( 'button' => array( @@ -393,10 +393,7 @@ public function data_generate_styles_fixtures() { 'text' => 'var:preset|color|roastbeef', 'background' => '#000', ), - 'effects' => array( - 'transition' => 'all 0.5s ease-out', - ), - ':hover' => array( + ':hover' => array( 'color' => array( 'text' => 'var:preset|color|pineapple', 'background' => 'var:preset|color|goldenrod', @@ -410,7 +407,7 @@ public function data_generate_styles_fixtures() { 'css_vars' => true, ), 'expected_output' => array( - 'css' => '.der-beste-button button { color: var(--wp--preset--color--roastbeef); background-color: #000; transition: all 0.5s ease-out; } .der-beste-button button:hover { color: var(--wp--preset--color--pineapple); background-color: var(--wp--preset--color--goldenrod); }', + 'css' => '.der-beste-button button { color: var(--wp--preset--color--roastbeef); background-color: #000; } .der-beste-button button:hover { color: var(--wp--preset--color--pineapple); background-color: var(--wp--preset--color--goldenrod); }', ), ), );