Skip to content

Commit

Permalink
fix section flex grow
Browse files Browse the repository at this point in the history
  • Loading branch information
kadencewp committed Jul 1, 2024
1 parent a63b95e commit 25faf21
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
20 changes: 20 additions & 0 deletions includes/blocks/class-kadence-blocks-column-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
$css->set_selector( '.kadence-column' . $unique_id . ' > .kt-inside-inner-col' );
$css->add_property( 'height', '100%' );
}
if ( isset( $attributes['flexGrow'][1] ) && $css->is_number( $attributes['flexGrow'][1] ) ) {
$css->set_media_state( 'tablet' );
$css->set_selector( '.kadence-column' . $unique_id . ', .wp-block-kadence-column.kb-section-dir-horizontal > .kt-inside-inner-col > .kadence-column' . $unique_id );
$css->add_property( 'flex-grow', $attributes['flexGrow'][1] );
$css->set_selector( '.kadence-column' . $unique_id . ' > .kt-inside-inner-col' );
$css->add_property( 'height', '100%' );
$css->set_media_state( 'desktop' );
}
if ( isset( $attributes['flexGrow'][2] ) && $css->is_number( $attributes['flexGrow'][2] ) ) {
$css->set_media_state( 'mobile' );
$css->set_selector( '.kadence-column' . $unique_id . ', .wp-block-kadence-column.kb-section-dir-horizontal > .kt-inside-inner-col > .kadence-column' . $unique_id );
$css->add_property( 'flex-grow', $attributes['flexGrow'][2] );
$css->set_selector( '.kadence-column' . $unique_id . ' > .kt-inside-inner-col' );
$css->add_property( 'height', '100%' );
$css->set_media_state( 'desktop' );
}
if ( ! empty( $attributes['maxWidth'][0] ) ) {
$css->set_selector( '.kadence-column' . $unique_id );
$css->add_property( 'max-width', $attributes['maxWidth'][0] . $max_width_unit );
Expand Down Expand Up @@ -677,6 +693,10 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
if ( ( 'horizontal' === $desktop_direction || 'horizontal-reverse' === $desktop_direction ) ) {
$css->add_property( 'flex-wrap', 'nowrap' );
}
if ( ( 'horizontal' === $desktop_direction || 'horizontal-reverse' === $desktop_direction ) ) {
$css->set_selector( '.wp-block-kadence-column.kb-section-dir-horizontal.kadence-column' . $unique_id . ' > .kt-inside-inner-col > *' );
$css->add_property( 'flex', 'unset' );
}
if ( ( 'horizontal' === $desktop_direction || 'horizontal-reverse' === $desktop_direction ) && ! empty( $attributes['flexBasis'][0] ) ) {
$css->set_selector( '.wp-block-kadence-column.kb-section-dir-horizontal.kadence-column' . $unique_id . ' > .kt-inside-inner-col > *' );
$css->add_property( 'flex', '1' );
Expand Down
4 changes: 2 additions & 2 deletions kadence-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Advanced Page Building Blocks for Gutenberg. Create custom column layouts, backgrounds, dual buttons, icons etc.
* Author: Kadence WP
* Author URI: https://www.kadencewp.com
* Version: 3.2.47
* Version: 3.2.48
* Requires PHP: 7.4
* Text Domain: kadence-blocks
* License: GPL2+
Expand All @@ -20,7 +20,7 @@
}
define( 'KADENCE_BLOCKS_PATH', realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR );
define( 'KADENCE_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
define( 'KADENCE_BLOCKS_VERSION', '3.2.47' );
define( 'KADENCE_BLOCKS_VERSION', '3.2.48' );

require_once plugin_dir_path( __FILE__ ) . 'vendor/vendor-prefixed/autoload.php';
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: gutenberg, blocks, page builder, editor, gutenberg blocks
Donate link: https://www.kadencewp.com/about-us/
Requires at least: 6.3
Tested up to: 6.5
Stable tag: 3.2.47
Stable tag: 3.2.48
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -174,9 +174,14 @@ Please report security bugs found in the Kadence Blocks plugin's source code thr

== Changelog ==

= 3.2.48 =
Release Date: June 27th 2024
* Fix: Issue with vertical alignment in tablet for sections.
* Fix: Issue with css priority of flex in sections.

= 3.2.47 =
Release Date: June 27th 2024
Update: WPML config.
* Update: WPML config.
* Fix: Possible issue with editor react error 311.
* Fix: Gallery image control buttons.

Expand Down
8 changes: 4 additions & 4 deletions src/blocks/column/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1697,8 +1697,8 @@ function SectionEdit(props) {
<ResponsiveAlignControls
label={__('Vertical Alignment', 'kadence-blocks')}
value={verticalAlignment ? verticalAlignment : ''}
mobileValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
tabletValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
tabletValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
mobileValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
onChange={(value) => {
let tempValue = value;
if ((verticalAlignment ? verticalAlignment : '') === value) {
Expand Down Expand Up @@ -1734,8 +1734,8 @@ function SectionEdit(props) {
<ResponsiveAlignControls
label={__('Vertical Alignment', 'kadence-blocks')}
value={verticalAlignment ? verticalAlignment : ''}
mobileValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
tabletValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
tabletValue={verticalAlignmentTablet ? verticalAlignmentTablet : ''}
mobileValue={verticalAlignmentMobile ? verticalAlignmentMobile : ''}
onChange={(value) => {
let tempValue = value;
if ((verticalAlignment ? verticalAlignment : '') === value) {
Expand Down

0 comments on commit 25faf21

Please sign in to comment.