PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.3
Elementor Website Builder – more than just a page builder v4.0.3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | modules/variables/classes/size-style-schema.php +16 -22 4.1.54.0.3 View file →
@@ -5,9 +5,8 @@
5 5 use Elementor\Modules\AtomicWidgets\PropTypes\Base\Array_Prop_Type;
6 6 use Elementor\Modules\AtomicWidgets\PropTypes\Base\Object_Prop_Type;
7 7 use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type;
8 8 use Elementor\Modules\AtomicWidgets\PropTypes\Union_Prop_Type;
9 -use Elementor\Modules\AtomicWidgets\Styles\Size_Constants;
10 9 use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type;
11 10
12 11 if ( ! defined( 'ABSPATH' ) ) {
13 12 exit; // Exit if accessed directly.
@@ -13,31 +12,30 @@
13 12 exit; // Exit if accessed directly.
14 13 }
15 14
16 15 class Size_Style_Schema {
17 - private $units_to_skip = [];
16 + private $blacklist = [
17 + 'box-shadow',
18 + 'filter',
19 + 'backdrop-filter',
20 + 'transform',
21 + 'transition',
22 + ];
18 23
19 - public function __construct() {
20 - $this->units_to_skip = [
21 - ...Size_Constants::angle(),
22 - ...Size_Constants::time(),
23 - ];
24 - }
25 -
26 - private function skip_by_units( Size_Prop_Type $size_prop_type ) {
27 - $settings = $size_prop_type->get_settings();
28 -
29 - if ( ! array_key_exists( 'available_units', $settings ) ) {
30 - return false;
24 + private function ignore( $css_property ): bool {
25 + if ( in_array( $css_property, $this->blacklist, true ) ) {
26 + return true;
31 27 }
32 28
33 - $available_units = $settings['available_units'];
34 -
35 - return count( array_intersect( $available_units, $this->units_to_skip ) ) > 0;
29 + return false;
36 30 }
37 31
38 32 public function augment( array $schema ): array {
39 33 foreach ( $schema as $css_property => $prop_type ) {
34 + if ( $this->ignore( $css_property ) ) {
35 + continue;
36 + }
37 +
40 38 $schema[ $css_property ] = $this->update( $prop_type );
41 39 }
42 40
43 41 return $schema;
@@ -62,13 +60,9 @@
62 60
63 61 return $prop_type;
64 62 }
65 63
66 - private function update_size( Size_Prop_Type $size_prop_type ) {
67 - if ( $this->skip_by_units( $size_prop_type ) ) {
68 - return $size_prop_type;
69 - }
70 -
64 + private function update_size( Size_Prop_Type $size_prop_type ): Union_Prop_Type {
71 65 return Union_Prop_Type::create_from( $size_prop_type )
72 66 ->add_prop_type( Size_Variable_Prop_Type::make() );
73 67 }
74 68