| 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 |
|