PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.4
Elementor Website Builder – more than just a page builder v4.3.4
4.3.4 4.3.3 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 All 457 releases
elementor / modules / mcp / abilities / utils / atomic-container-presentation.php

atomic-container-presentation.php in Elementor Website Builder – more than just a page builder 4.3.4, at modules/mcp/abilities/utils/atomic-container-presentation.php

43 lines 1.4 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\Mcp\Abilities\Utils;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 /**
10 * Every atomic element (not widget) renders with the `.e-con` class. These are the declarations
11 * from assets/dev/scss/frontend/_container.scss that affect atomic elements, kept in sync by a
12 * PHPUnit check.
13 *
14 * The kit's Container Padding (10px by default) is left out on purpose: `.e-con` applies it as
15 * inline padding only, the base padding of most atomic elements overrides it, and the value is
16 * user-editable per breakpoint so it can't be hardcoded here.
17 */
18 class Atomic_Container_Presentation {
19
20 const WIDGET_EL_TYPE = 'widget';
21
22 const SHELL_STYLES = [
23 'position' => 'relative',
24 'width' => '100%',
25 'min-width' => '0',
26 ];
27
28 const SHELL_CSS = '.e-con{position:relative;width:100%;min-width:0;}';
29
30 const DOCUMENT_ROOT_SHELL_CSS = '.e-con{position:relative;width:100%;min-width:0;margin-inline-start:auto;margin-inline-end:auto;max-width:100%;}';
31
32 public static function applies_to( array $element_config ): bool {
33 $is_atomic = ! empty( $element_config['atomic'] );
34 $is_element = self::WIDGET_EL_TYPE !== ( $element_config['elType'] ?? self::WIDGET_EL_TYPE );
35
36 return $is_atomic && $is_element;
37 }
38
39 public static function to_css_string( bool $is_document_root ): string {
40 return $is_document_root ? self::DOCUMENT_ROOT_SHELL_CSS : self::SHELL_CSS;
41 }
42 }
43