PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.2
Elementor Website Builder – more than just a page builder v4.3.2
4.3.2 4.3.1 4.3.0 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 All 455 releases
elementor / modules / atomic-widgets / css-converter / shorthand-expander.php

shorthand-expander.php in Elementor Website Builder – more than just a page builder 4.3.2, at modules/atomic-widgets/css-converter/shorthand-expander.php

30 lines 1021 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\CssConverter;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 /**
10 * A pre-processing pass that rewrites a single shorthand declaration (e.g. `border`) into the
11 * longhand declarations the schema-bound converters already understand. Runs before the converter
12 * loop so the converter registry stays a 1:1 mirror of Style_Schema and the shorthand never becomes a
13 * prop or a coverage key.
14 */
15 interface Shorthand_Expander {
16 /**
17 * @param array{property: string, value: string} $rule A single parsed CSS declaration.
18 */
19 public function is_supported( array $rule ): bool;
20
21 /**
22 * Rewrite the shorthand into longhand declarations. Returning an empty array declines the
23 * expansion, so the original shorthand is kept and routed to custom_css.
24 *
25 * @param array{property: string, value: string} $rule
26 * @return array<int, array{property: string, value: string, declaration: string}>
27 */
28 public function expand( array $rule ): array;
29 }
30