PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
← All changes | includes/classes/block-global.php +9 -4 2.9.02.13.1 View file →
@@ -77,10 +77,14 @@
77 77 '_background' => 'background',
78 78 '_boxShadow' => 'box-shadow',
79 79 ];
80 80 foreach ( $transition_types as $key => $property ) {
81 - if ( isset( $attribute[ $key ] ) ) {
82 - $duration = ! empty( $attribute[ $key ]['transitionDuration'] ) ? $attribute[ $key ]['transitionDuration'] : '0';
81 + // Only add a transition when the user actually set a non-zero
82 + // duration. Previously every block emitted the no-op
83 + // "transition:border 0s ease,background 0s ease,box-shadow 0s ease"
84 + // on its wrapper (0s = no transition) — dead CSS on every block.
85 + if ( isset( $attribute[ $key ]['transitionDuration'] ) && (float) $attribute[ $key ]['transitionDuration'] > 0 ) {
86 + $duration = $attribute[ $key ]['transitionDuration'];
83 87 $transitions[] = "{$property} {$duration}s ease";
84 88 }
85 89 }
86 90 $transition_string = implode( ',', $transitions );
@@ -87,9 +91,9 @@
87 91
88 92 $css = array_merge(
89 93 Dimensions::get_css( $attribute['_margin'], 'margin', $device ),
90 94 Dimensions::get_css( $attribute['_padding'], 'padding', $device ),
91 - Mask::get_css( $attribute['_mask'], $device ),
95 + Mask::get_css( $attribute['_mask'], '', $device ),
92 96 Background::get_css( $attribute['_background'], 'background', $device ),
93 97 Border::get_css( $attribute['_border'], '', $device ),
94 98 Width::get_css( $attribute['_width'], 'width', $device ),
95 99 BoxShadow::get_css( $attribute['_boxShadow'], $device ),
@@ -94,9 +98,10 @@
94 98 Width::get_css( $attribute['_width'], 'width', $device ),
95 99 BoxShadow::get_css( $attribute['_boxShadow'], $device ),
96 100 Position::get_css( $attribute['_position'], 'position', $device ),
97 101 Zindex::get_css( $attribute['_zIndex'], 'z-index', $device ),
98 - [ 'transition' => $transition_string ]
102 + // Only emit transition when there's a real (non-zero) one.
103 + '' !== $transition_string ? [ 'transition' => $transition_string ] : []
99 104 );
100 105 return apply_filters( 'ablocks/get_block_common_wrapper_css', $css, $attribute, $device );
101 106 }
102 107 public static function get_wrapper_hover_css( $attribute, $device = '' ) {