From: soufiane Date: Thu, 4 May 2023 16:33:32 +0000 (+0200) Subject: wip #5874 @7:00 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bfe142c74ffa96f66b18f2fb3ad45c5d4a701f0d;p=sycomore-fondation.git wip #5874 @7:00 --- diff --git a/wp-content/mu-plugins/cube/Init.php b/wp-content/mu-plugins/cube/Init.php index 2016db8..6d9b794 100644 --- a/wp-content/mu-plugins/cube/Init.php +++ b/wp-content/mu-plugins/cube/Init.php @@ -22,7 +22,6 @@ class Setup { $this->customise_sections(); $this->customise_widget(); - $this->customise_container(); } public function register_widgets($widgets_manager) { @@ -169,20 +168,12 @@ class Setup { public function customise_widget() { // Add some extra hooks that we can use on the Elementor elements... add_action('elementor/frontend/widget/before_render', function (Element_Base $element) { - // Add number child items in this container - //$element->add_render_attribute('_wrapper', 'class', 'm-0'); - + if($element->get_name() === "image") { + $element->add_render_attribute('_wrapper', 'class', 'image-single-container'); + } }, 10, 3); } - public function customise_container() { - // Add some extra hooks that we can use on the Elementor elements... - add_action('elementor/frontend/container/before_render', function (Element_Base $element) { - // Add number child items in this container - var_dump($element); - }); - } - public static function spacing_options() { // List of base spacing scales along with their descriptions // Note: this should match what is in the theme's `tailwind.config.cjs` @@ -193,7 +184,7 @@ class Setup { '2xs' => '2XS (8px — 10px)', 'xs' => 'XS (12px — 15px)', 's' => 'S (16px — 20px)', - 'm' => 'M (24px — 30px)', + 'm' => 'M (23px)', 'l' => 'L (32px — 40px)', 'xl' => 'XL (48px — 60px)', '2xl' => '2XL (64px — 80px)', @@ -217,6 +208,7 @@ class Setup { 'm-xl' => 'M ↔ XL (24px — 60px)', 'l-xl' => 'L ↔ XL (34px — 86px)', 'l-2xl' => 'L ↔ 2XL (38px — 86px)', + '2xl-custom' => '2XL (72px — 86px)', '2xl-5xl' => '2XL ↔ 5XL (72px — 126px)', ]; } diff --git a/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php b/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php new file mode 100644 index 0000000..bde9573 --- /dev/null +++ b/wp-content/mu-plugins/cube/Widgets/CarouselSelection.php @@ -0,0 +1,36 @@ +start_controls_section( + 'content_section', + [ + 'label' => esc_html__('Content', 'cube'), + 'tab' => Controls_Manager::TAB_CONTENT, + ] + ); + } + +} \ No newline at end of file diff --git a/wp-content/mu-plugins/cube/Widgets/HighlightTitle.php b/wp-content/mu-plugins/cube/Widgets/HighlightTitle.php index 5093249..db41ff1 100644 --- a/wp-content/mu-plugins/cube/Widgets/HighlightTitle.php +++ b/wp-content/mu-plugins/cube/Widgets/HighlightTitle.php @@ -118,6 +118,27 @@ class HighlightTitle extends _Base { 'toggle' => true, ] ); + + $this->add_control( + 'text_position', + [ + 'label' => esc_html__( 'Text position', 'cube' ), + 'type' => Controls_Manager::SELECT, + 'options' => [ + 'left' => [ + 'title' => esc_html__( 'Left', 'cube' ), + ], + 'center' => [ + 'title' => esc_html__( 'Center', 'cube' ), + ], + 'right' => [ + 'title' => esc_html__( 'Right', 'cube' ), + ] + ], + 'default' => 'right', + 'toggle' => true, + ] + ); } /** @@ -134,6 +155,7 @@ class HighlightTitle extends _Base { $title_tag = $this->get_settings('title_tag'); $size = $this->get_settings('text_size'); $weight = $this->get_settings('text_weight'); + $position = $this->get_settings('text_position'); $size_classes = [ 'large' => 'text-lg', @@ -144,7 +166,7 @@ class HighlightTitle extends _Base { $this->add_inline_editing_attributes('title', 'none'); // CSS Classes for elements - $this->add_render_attribute('title', 'class', ["highlight relative font-$weight $size_classes[$size]"]); + $this->add_render_attribute('title', 'class', ["highlight relative font-$weight $size_classes[$size] auto-$position"]); // Rendered content @@ -171,12 +193,18 @@ class HighlightTitle extends _Base { weight_classes = { 'bold': 'font-bold', 'semibold': 'font-semibold', - } + }; + + position_classes = { + 'left': 'auto-left', + 'center': 'auto-center', + 'right': 'auto-right', + }; view.addRenderAttribute( 'title', { - 'class': [ 'highlight', weight_classes[settings.text_weight], size_classes[settings.text_size] ] + 'class': [ 'highlight', weight_classes[settings.text_weight], size_classes[settings.text_size], position_classes[settings.text_position] ] } ); @@ -184,10 +212,10 @@ class HighlightTitle extends _Base { #> <# if ('' !== settings.title) { #> - <{{{ settings.title_tag }}} {{{ view.getRenderAttributeString( 'title' ) }}}> - {{{ settings.title }}} - - + <{{{ settings.title_tag }}} {{{ view.getRenderAttributeString( 'title' ) }}}> + {{{ settings.title }}} + + <# } #>