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

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