PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
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 / modules / atomic-widgets / styles / style-definition.php

style-definition.php in Elementor Website Builder – more than just a page builder 4.2.0, at modules/atomic-widgets/styles/style-definition.php

43 lines 759 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\AtomicWidgets\Styles;
4
5 class Style_Definition {
6 private string $type = 'class';
7 private string $label = '';
8
9 /** @var Style_Variant[] */
10 private array $variants = [];
11
12 public static function make(): self {
13 return new self();
14 }
15
16 public function set_type( string $type ): self {
17 $this->type = $type;
18
19 return $this;
20 }
21
22 public function set_label( string $label ): self {
23 $this->label = $label;
24
25 return $this;
26 }
27
28 public function add_variant( Style_Variant $variant ): self {
29 $this->variants[] = $variant->build();
30
31 return $this;
32 }
33
34 public function build( string $id ): array {
35 return [
36 'id' => $id,
37 'type' => $this->type,
38 'label' => $this->label,
39 'variants' => $this->variants,
40 ];
41 }
42 }
43