PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.2
Elementor Website Builder – more than just a page builder v3.32.2
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 / size-constants.php

size-constants.php in Elementor Website Builder – more than just a page builder 3.32.2, at modules/atomic-widgets/styles/size-constants.php

130 lines 2.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\Modules\AtomicWidgets\Styles;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Size_Constants {
10 const UNIT_PX = 'px';
11 const UNIT_PERCENT = '%';
12 const UNIT_EM = 'em';
13 const UNIT_REM = 'rem';
14 const UNIT_VW = 'vw';
15 const UNIT_VH = 'vh';
16 const UNIT_AUTO = 'auto';
17 const UNIT_CUSTOM = 'custom';
18 const UNIT_SECOND = 's';
19 const UNIT_MILLI_SECOND = 'ms';
20 const UNIT_ANGLE_DEG = 'deg';
21
22 const LENGTH_UNITS = [
23 self::UNIT_PX,
24 self::UNIT_EM,
25 self::UNIT_REM,
26 self::UNIT_VW,
27 self::UNIT_VH,
28 ];
29
30 const TIME_UNITS = [ self::UNIT_SECOND, self::UNIT_MILLI_SECOND ];
31 const EXTENDED_UNITS = [ self::UNIT_AUTO, self::UNIT_CUSTOM ];
32 const VIEWPORT_MIN_MAX_UNITS = [ 'vmin', 'vmax' ];
33 const ANGLE_UNITS = [ self::UNIT_ANGLE_DEG, 'rad', 'grad', 'turn' ];
34
35 public static function all_supported_units(): array {
36 return array_merge(
37 self::all(),
38 self::ANGLE_UNITS,
39 self::TIME_UNITS,
40 self::EXTENDED_UNITS,
41 self::VIEWPORT_MIN_MAX_UNITS,
42 );
43 }
44
45 public static function all(): array {
46 return [
47 ...self::LENGTH_UNITS,
48 self::UNIT_PERCENT,
49 self::UNIT_AUTO,
50 ];
51 }
52
53 private static function units_without_auto(): array {
54 return [ ...self::LENGTH_UNITS, self::UNIT_PERCENT ];
55 }
56
57 public static function layout() {
58 return self::units_without_auto();
59 }
60
61 public static function spacing(): array {
62 return self::units_without_auto();
63 }
64
65 public static function position(): array {
66 return self::units_without_auto();
67 }
68
69 public static function anchor_offset() {
70 return self::LENGTH_UNITS;
71 }
72
73 public static function typography(): array {
74 return self::units_without_auto();
75 }
76
77 public static function stroke_width() {
78 return [
79 self::UNIT_PX,
80 self::UNIT_EM,
81 self::UNIT_REM,
82 ];
83 }
84
85 public static function transition() {
86 return self::TIME_UNITS;
87 }
88
89 public static function border(): array {
90 return self::units_without_auto();
91 }
92
93
94 public static function opacity(): array {
95 return [ self::UNIT_PERCENT ];
96 }
97
98 public static function box_shadow(): array {
99 return self::units_without_auto();
100 }
101
102 public static function rotate(): array {
103 return self::ANGLE_UNITS;
104 }
105
106 public static function transform(): array {
107 return self::units_without_auto();
108 }
109
110 public static function drop_shadow() {
111 return self::LENGTH_UNITS;
112 }
113
114 public static function blur_filter() {
115 return self::LENGTH_UNITS;
116 }
117
118 public static function intensity_filter() {
119 return [ self::UNIT_PERCENT ];
120 }
121
122 public static function color_tone_filter() {
123 return [ self::UNIT_PERCENT ];
124 }
125
126 public static function hue_rotate_filter() {
127 return self::ANGLE_UNITS;
128 }
129 }
130