PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.6
Elementor Website Builder – more than just a page builder v3.0.6
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
elementor / core / kits / documents / tabs / theme-style-buttons.php

theme-style-buttons.php in Elementor Website Builder – more than just a page builder 3.0.6, at core/kits/documents/tabs/theme-style-buttons.php

226 lines 4.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Core\Kits\Documents\Tabs;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Border;
7 use Elementor\Group_Control_Box_Shadow;
8 use Elementor\Group_Control_Text_Shadow;
9 use Elementor\Group_Control_Typography;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 class Theme_Style_Buttons extends Tab_Base {
16
17 public function get_id() {
18 return 'theme-style-buttons';
19 }
20
21 public function get_title() {
22 return __( 'Buttons', 'elementor' );
23 }
24
25 protected function register_tab_controls() {
26 $button_selectors = [
27 '{{WRAPPER}} button',
28 '{{WRAPPER}} input[type="button"]',
29 '{{WRAPPER}} input[type="submit"]',
30 '{{WRAPPER}} .elementor-button',
31 ];
32
33 $button_hover_selectors = [
34 '{{WRAPPER}} button:hover',
35 '{{WRAPPER}} button:focus',
36 '{{WRAPPER}} input[type="button"]:hover',
37 '{{WRAPPER}} input[type="button"]:focus',
38 '{{WRAPPER}} input[type="submit"]:hover',
39 '{{WRAPPER}} input[type="submit"]:focus',
40 '{{WRAPPER}} .elementor-button:hover',
41 '{{WRAPPER}} .elementor-button:focus',
42 ];
43
44 $button_selector = implode( ',', $button_selectors );
45 $button_hover_selector = implode( ',', $button_hover_selectors );
46
47 $this->start_controls_section(
48 'section_buttons',
49 [
50 'label' => __( 'Buttons', 'elementor' ),
51 'tab' => $this->get_id(),
52 ]
53 );
54
55 $this->add_default_globals_notice();
56
57 $this->add_group_control(
58 Group_Control_Typography::get_type(),
59 [
60 'label' => __( 'Typography', 'elementor' ),
61 'name' => 'button_typography',
62 'selector' => $button_selector,
63 ]
64 );
65
66 $this->add_group_control(
67 Group_Control_Text_Shadow::get_type(),
68 [
69 'name' => 'button_text_shadow',
70 'selector' => $button_selector,
71 ]
72 );
73
74 $this->start_controls_tabs( 'tabs_button_style' );
75
76 $this->start_controls_tab(
77 'tab_button_normal',
78 [
79 'label' => __( 'Normal', 'elementor' ),
80 ]
81 );
82
83 $this->add_control(
84 'button_text_color',
85 [
86 'label' => __( 'Text Color', 'elementor' ),
87 'type' => Controls_Manager::COLOR,
88 'dynamic' => [],
89 'selectors' => [
90 $button_selector => 'color: {{VALUE}};',
91 ],
92 ]
93 );
94
95 $this->add_control(
96 'button_background_color',
97 [
98 'label' => __( 'Background Color', 'elementor' ),
99 'type' => Controls_Manager::COLOR,
100 'dynamic' => [],
101 'selectors' => [
102 $button_selector => 'background-color: {{VALUE}};',
103 ],
104 ]
105 );
106
107 $this->add_group_control(
108 Group_Control_Box_Shadow::get_type(),
109 [
110 'name' => 'button_box_shadow',
111 'selector' => $button_selector,
112 ]
113 );
114
115 $this->add_group_control(
116 Group_Control_Border::get_type(),
117 [
118 'name' => 'button_border',
119 'selector' => $button_selector,
120 'fields_options' => [
121 'color' => [
122 'dynamic' => [],
123 ],
124 ],
125 ]
126 );
127
128 $this->add_control(
129 'button_border_radius',
130 [
131 'label' => __( 'Border Radius', 'elementor' ),
132 'type' => Controls_Manager::DIMENSIONS,
133 'size_units' => [ 'px', '%' ],
134 'selectors' => [
135 $button_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
136 ],
137 ]
138 );
139
140 $this->end_controls_tab();
141
142 $this->start_controls_tab(
143 'tab_button_hover',
144 [
145 'label' => __( 'Hover', 'elementor' ),
146 ]
147 );
148
149 $this->add_control(
150 'button_hover_text_color',
151 [
152 'label' => __( 'Text Color', 'elementor' ),
153 'type' => Controls_Manager::COLOR,
154 'dynamic' => [],
155 'selectors' => [
156 $button_hover_selector => 'color: {{VALUE}};',
157 ],
158 ]
159 );
160
161 $this->add_control(
162 'button_hover_background_color',
163 [
164 'label' => __( 'Background Color', 'elementor' ),
165 'type' => Controls_Manager::COLOR,
166 'dynamic' => [],
167 'selectors' => [
168 $button_hover_selector => 'background-color: {{VALUE}};',
169 ],
170 ]
171 );
172
173 $this->add_group_control(
174 Group_Control_Box_Shadow::get_type(),
175 [
176 'name' => 'button_hover_box_shadow',
177 'selector' => $button_hover_selector,
178 ]
179 );
180
181 $this->add_group_control(
182 Group_Control_Border::get_type(),
183 [
184 'name' => 'button_hover_border',
185 'selector' => $button_hover_selector,
186 'fields_options' => [
187 'color' => [
188 'dynamic' => [],
189 ],
190 ],
191 ]
192 );
193
194 $this->add_control(
195 'button_hover_border_radius',
196 [
197 'label' => __( 'Border Radius', 'elementor' ),
198 'type' => Controls_Manager::DIMENSIONS,
199 'size_units' => [ 'px', '%' ],
200 'selectors' => [
201 $button_hover_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
202 ],
203 ]
204 );
205
206 $this->end_controls_tab();
207
208 $this->end_controls_tabs();
209
210 $this->add_responsive_control(
211 'button_padding',
212 [
213 'label' => __( 'Padding', 'elementor' ),
214 'type' => Controls_Manager::DIMENSIONS,
215 'size_units' => [ 'px', 'em', '%' ],
216 'selectors' => [
217 $button_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
218 ],
219 'separator' => 'before',
220 ]
221 );
222
223 $this->end_controls_section();
224 }
225 }
226