if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
* Elementor text stroke control.
* A group control for creating a stroke effect on text. Displays input fields to define
* the text stroke and color stroke.
class Group_Control_Text_Stroke extends Group_Control_Base {
* Holds all the text stroke control fields.
* @var array Text Stroke control fields.
protected static $fields;
* Get text stroke control type.
* Retrieve the control type, in this case `text-stroke`.
* @return string Control type.
public static function get_type() {
* Initialize text stroke control fields.
* @return array Control fields.
protected function init_fields() {
$controls['text_stroke'] = [
'label' => esc_html__( 'Text Stroke', 'elementor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'em', 'rem', 'custom' ],
'selector' => '{{WRAPPER}}',
'{{SELECTOR}}' => '-webkit-text-stroke-width: {{SIZE}}{{UNIT}}; stroke-width: {{SIZE}}{{UNIT}};',
$controls['stroke_color'] = [
'label' => esc_html__( 'Stroke Color', 'elementor' ),
'type' => Controls_Manager::COLOR,
'selector' => '{{WRAPPER}}',
'{{SELECTOR}}' => '-webkit-text-stroke-color: {{VALUE}}; stroke: {{VALUE}};',
* Retrieve the default options of the text stroke control. Used to return the
* default options while initializing the text stroke control.
* @return array Default text stroke control options.
protected function get_default_options() {
'starter_title' => esc_html__( 'Text Stroke', 'elementor' ),
'starter_name' => 'text_stroke_type',
'starter_value' => 'yes',