PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.0-dev1
Elementor Website Builder – more than just a page builder v3.16.0-dev1
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 4.0.7 All 451 releases
elementor / includes / controls / groups / text-stroke.php

text-stroke.php in Elementor Website Builder – more than just a page builder 3.16.0-dev1, at includes/controls/groups/text-stroke.php

123 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor text stroke control.
10 *
11 * A group control for creating a stroke effect on text. Displays input fields to define
12 * the text stroke and color stroke.
13 *
14 * @since 3.5.0
15 */
16 class Group_Control_Text_Stroke extends Group_Control_Base {
17
18 /**
19 * Fields.
20 *
21 * Holds all the text stroke control fields.
22 *
23 * @since 3.5.0
24 * @access protected
25 * @static
26 *
27 * @var array Text Stroke control fields.
28 */
29 protected static $fields;
30
31 /**
32 * Get text stroke control type.
33 *
34 * Retrieve the control type, in this case `text-stroke`.
35 *
36 * @since 3.5.0
37 * @access public
38 * @static
39 *
40 * @return string Control type.
41 */
42 public static function get_type() {
43 return 'text-stroke';
44 }
45
46 /**
47 * Init fields.
48 *
49 * Initialize text stroke control fields.
50 *
51 * @since 3.5.0
52 * @access protected
53 *
54 * @return array Control fields.
55 */
56 protected function init_fields() {
57 $controls = [];
58
59 $controls['text_stroke'] = [
60 'label' => esc_html__( 'Text Stroke', 'elementor' ),
61 'type' => Controls_Manager::SLIDER,
62 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
63 'range' => [
64 'px' => [
65 'min' => 0,
66 'max' => 10,
67 ],
68 'em' => [
69 'min' => 0,
70 'max' => 1,
71 'step' => 0.01,
72 ],
73 'rem' => [
74 'min' => 0,
75 'max' => 1,
76 'step' => 0.01,
77 ],
78 ],
79 'responsive' => true,
80 'selector' => '{{WRAPPER}}',
81 'selectors' => [
82 '{{SELECTOR}}' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}}; stroke-width: {{SIZE}}{{UNIT}};',
83 ],
84 ];
85
86 $controls['stroke_color'] = [
87 'label' => esc_html__( 'Stroke Color', 'elementor' ),
88 'type' => Controls_Manager::COLOR,
89 'default' => '#000',
90 'selector' => '{{WRAPPER}}',
91 'selectors' => [
92 '{{SELECTOR}}' => '-webkit-text-stroke-color: {{VALUE}}; stroke: {{VALUE}};',
93 ],
94 ];
95
96 return $controls;
97 }
98
99 /**
100 * Get default options.
101 *
102 * Retrieve the default options of the text stroke control. Used to return the
103 * default options while initializing the text stroke control.
104 *
105 * @since 3.5.0
106 * @access protected
107 *
108 * @return array Default text stroke control options.
109 */
110 protected function get_default_options() {
111 return [
112 'popover' => [
113 'starter_title' => esc_html_x( 'Text Stroke', 'Text Stroke Control', 'elementor' ),
114 'starter_name' => 'text_stroke_type',
115 'starter_value' => 'yes',
116 'settings' => [
117 'render_type' => 'ui',
118 ],
119 ],
120 ];
121 }
122 }
123