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

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

257 lines 5.6 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_Background;
7 use Elementor\Group_Control_Border;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Text_Shadow;
10 use Elementor\Group_Control_Typography;
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 class Theme_Style_Buttons extends Tab_Base {
17
18 public function get_id() {
19 return 'theme-style-buttons';
20 }
21
22 public function get_title() {
23 return esc_html__( 'Buttons', 'elementor' );
24 }
25
26 public function get_group() {
27 return 'theme-style';
28 }
29
30 public function get_icon() {
31 return 'eicon-button';
32 }
33
34 public function get_help_url() {
35 return 'https://go.elementor.com/global-theme-style-buttons';
36 }
37
38 protected function register_tab_controls() {
39 $button_selectors = [
40 '{{WRAPPER}} button',
41 '{{WRAPPER}} input[type="button"]',
42 '{{WRAPPER}} input[type="submit"]',
43 '{{WRAPPER}} .elementor-button',
44 ];
45
46 $button_hover_selectors = [
47 '{{WRAPPER}} button:hover',
48 '{{WRAPPER}} button:focus',
49 '{{WRAPPER}} input[type="button"]:hover',
50 '{{WRAPPER}} input[type="button"]:focus',
51 '{{WRAPPER}} input[type="submit"]:hover',
52 '{{WRAPPER}} input[type="submit"]:focus',
53 '{{WRAPPER}} .elementor-button:hover',
54 '{{WRAPPER}} .elementor-button:focus',
55 ];
56
57 $button_selector = implode( ',', $button_selectors );
58 $button_hover_selector = implode( ',', $button_hover_selectors );
59
60 $this->start_controls_section(
61 'section_buttons',
62 [
63 'label' => esc_html__( 'Buttons', 'elementor' ),
64 'tab' => $this->get_id(),
65 ]
66 );
67
68 $this->add_default_globals_notice();
69
70 $this->add_group_control(
71 Group_Control_Typography::get_type(),
72 [
73 'label' => esc_html__( 'Typography', 'elementor' ),
74 'name' => 'button_typography',
75 'selector' => $button_selector,
76 ]
77 );
78
79 $this->add_group_control(
80 Group_Control_Text_Shadow::get_type(),
81 [
82 'name' => 'button_text_shadow',
83 'selector' => $button_selector,
84 ]
85 );
86
87 $this->start_controls_tabs( 'tabs_button_style' );
88
89 $this->start_controls_tab(
90 'tab_button_normal',
91 [
92 'label' => esc_html__( 'Normal', 'elementor' ),
93 ]
94 );
95
96 $this->add_control(
97 'button_text_color',
98 [
99 'label' => esc_html__( 'Text Color', 'elementor' ),
100 'type' => Controls_Manager::COLOR,
101 'dynamic' => [],
102 'selectors' => [
103 $button_selector => 'color: {{VALUE}};',
104 ],
105 ]
106 );
107
108 $this->add_group_control(
109 Group_Control_Background::get_type(),
110 [
111 'name' => 'button_background',
112 'types' => [ 'classic', 'gradient' ],
113 'exclude' => [ 'image' ],
114 'selector' => $button_selector,
115 'fields_options' => [
116 'background' => [
117 'default' => 'classic',
118 ],
119 'color' => [
120 'dynamic' => [],
121 ],
122 'color_b' => [
123 'dynamic' => [],
124 ],
125 ],
126 ]
127 );
128
129 $this->add_group_control(
130 Group_Control_Box_Shadow::get_type(),
131 [
132 'name' => 'button_box_shadow',
133 'selector' => $button_selector,
134 ]
135 );
136
137 $this->add_group_control(
138 Group_Control_Border::get_type(),
139 [
140 'name' => 'button_border',
141 'selector' => $button_selector,
142 'fields_options' => [
143 'color' => [
144 'dynamic' => [],
145 ],
146 ],
147 ]
148 );
149
150 $this->add_control(
151 'button_border_radius',
152 [
153 'label' => esc_html__( 'Border Radius', 'elementor' ),
154 'type' => Controls_Manager::DIMENSIONS,
155 'size_units' => [ 'px', '%' ],
156 'selectors' => [
157 $button_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
158 ],
159 ]
160 );
161
162 $this->end_controls_tab();
163
164 $this->start_controls_tab(
165 'tab_button_hover',
166 [
167 'label' => esc_html__( 'Hover', 'elementor' ),
168 ]
169 );
170
171 $this->add_control(
172 'button_hover_text_color',
173 [
174 'label' => esc_html__( 'Text Color', 'elementor' ),
175 'type' => Controls_Manager::COLOR,
176 'dynamic' => [],
177 'selectors' => [
178 $button_hover_selector => 'color: {{VALUE}};',
179 ],
180 ]
181 );
182
183 $this->add_group_control(
184 Group_Control_Background::get_type(),
185 [
186 'name' => 'button_hover_background',
187 'types' => [ 'classic', 'gradient' ],
188 'exclude' => [ 'image' ],
189 'selector' => $button_hover_selector,
190 'fields_options' => [
191 'background' => [
192 'default' => 'classic',
193 ],
194 'color' => [
195 'dynamic' => [],
196 ],
197 'color_b' => [
198 'dynamic' => [],
199 ],
200 ],
201 ]
202 );
203
204 $this->add_group_control(
205 Group_Control_Box_Shadow::get_type(),
206 [
207 'name' => 'button_hover_box_shadow',
208 'selector' => $button_hover_selector,
209 ]
210 );
211
212 $this->add_group_control(
213 Group_Control_Border::get_type(),
214 [
215 'name' => 'button_hover_border',
216 'selector' => $button_hover_selector,
217 'fields_options' => [
218 'color' => [
219 'dynamic' => [],
220 ],
221 ],
222 ]
223 );
224
225 $this->add_control(
226 'button_hover_border_radius',
227 [
228 'label' => esc_html__( 'Border Radius', 'elementor' ),
229 'type' => Controls_Manager::DIMENSIONS,
230 'size_units' => [ 'px', '%' ],
231 'selectors' => [
232 $button_hover_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
233 ],
234 ]
235 );
236
237 $this->end_controls_tab();
238
239 $this->end_controls_tabs();
240
241 $this->add_responsive_control(
242 'button_padding',
243 [
244 'label' => esc_html__( 'Padding', 'elementor' ),
245 'type' => Controls_Manager::DIMENSIONS,
246 'size_units' => [ 'px', 'em', '%' ],
247 'selectors' => [
248 $button_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
249 ],
250 'separator' => 'before',
251 ]
252 );
253
254 $this->end_controls_section();
255 }
256 }
257