PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.4
JetFormBuilder — Dynamic Blocks Form Builder v3.5.4
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / jet-style / css-compilers / border-radius-css-compiler.php
jetformbuilder / modules / jet-style / css-compilers Last commit date
base-css-compiler.php 2 years ago border-css-compiler.php 2 years ago border-radius-css-compiler.php 2 years ago
border-radius-css-compiler.php
77 lines
1 <?php
2
3
4 namespace JFB_Modules\Jet_Style\Css_Compilers;
5
6 use Jet_Form_Builder\Classes\Arrayable\Array_Tools;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 /**
14 * @since 3.1.0
15 *
16 * Class Border_Radius_Css_Compiler
17 * @package Jet_Form_Builder\Compatibility\Wp_Experiments\Css_Compilers
18 */
19 class Border_Radius_Css_Compiler extends Base_Css_Compiler {
20
21 public function is_supported( array $path ): bool {
22 return (
23 'border' === ( $path[1] ?? '' ) &&
24 'radius' === Array_Tools::last( $path )
25 );
26 }
27
28 public function compile_declarations(
29 \WP_Style_Engine_CSS_Declarations $declarations,
30 array $root_styles,
31 array &$class_names
32 ) {
33 $base_radius = Array_Tools::get( $root_styles, $this->path, array() );
34
35 if ( empty( $base_radius ) ) {
36 return;
37 }
38
39 $declarations->add_declaration(
40 "{$this->css_var}-top-left",
41 $this->get_top_left( $base_radius )
42 );
43
44 $declarations->add_declaration(
45 "{$this->css_var}-top-right",
46 $this->get_top_right( $base_radius )
47 );
48
49 $declarations->add_declaration(
50 "{$this->css_var}-bottom-right",
51 $this->get_bottom_right( $base_radius )
52 );
53
54 $declarations->add_declaration(
55 "{$this->css_var}-bottom-left",
56 $this->get_bottom_left( $base_radius )
57 );
58 }
59
60 public function get_top_left( $value ) {
61 return is_array( $value ) ? $value['topLeft'] : $value;
62 }
63
64 public function get_top_right( $value ) {
65 return is_array( $value ) ? $value['topRight'] : $value;
66 }
67
68 public function get_bottom_left( $value ) {
69 return is_array( $value ) ? $value['bottomLeft'] : $value;
70 }
71
72 public function get_bottom_right( $value ) {
73 return is_array( $value ) ? $value['bottomRight'] : $value;
74 }
75
76 }
77