| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\Styles; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; // Exit if accessed directly. |
| 7 |
} |
| 8 |
|
| 9 |
class Grid_Track_Renderer { |
| 10 |
public const GRID_TRACK_PROPERTIES = [ 'grid-template-columns', 'grid-template-rows' ]; |
| 11 |
|
| 12 |
public static function is_grid_track_property( ?string $css_property ): bool { |
| 13 |
return in_array( $css_property, self::GRID_TRACK_PROPERTIES, true ); |
| 14 |
} |
| 15 |
|
| 16 |
public static function format_repeat( int $count ): ?string { |
| 17 |
if ( $count < 1 ) { |
| 18 |
return null; |
| 19 |
} |
| 20 |
|
| 21 |
return "repeat({$count}, 1fr)"; |
| 22 |
} |
| 23 |
} |
| 24 |
|