Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/KAD-3421 #644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions includes/blocks/class-kadence-blocks-row-layout-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,22 +546,22 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
if ( ! empty( $attributes['collapseOrder'] ) && 'left-to-right' !== $attributes['collapseOrder'] && in_array( $layout, $collapse_layouts ) ) {
$css->set_media_state( 'tablet' );
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . $item_count . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . $item_count . ')' );
$css->add_property( 'order', ( $columns - $item_count + 1 ) );
}
// Row Two.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 11 ) );
}
// Row Three.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 21 ) );
}
// Row Four.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 31 ) );
}
$css->set_media_state( 'desktop' );
Expand All @@ -586,22 +586,22 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
//tablet ordering
if ( ! empty( $attributes['collapseOrder'] ) && 'left-to-right' !== $attributes['collapseOrder'] && in_array( $tabletLayout, $collapse_layouts ) ) {
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . $item_count . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . $item_count . ')' );
$css->add_property( 'order', ( $columns - $item_count + 1 ) );
}
// Row Two.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 11 ) );
}
// Row Three.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 21 ) );
}
// Row Four.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 31 ) );
}
}
Expand All @@ -616,22 +616,22 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
//tablet collapse ordering
if ( ! empty( $attributes['collapseOrder'] ) && 'left-to-right' !== $attributes['collapseOrder'] && in_array( $collapse_tab_layout, $collapse_layouts ) ) {
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . $item_count . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . $item_count . ')' );
$css->add_property( 'order', ( $columns - $item_count + 1 ) );
}
// Row Two.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 11 ) );
}
// Row Three.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 21 ) );
}
// Row Four.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 31 ) );
}
}
Expand All @@ -647,22 +647,22 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
//mobile ordering
if ( ! empty( $attributes['collapseOrder'] ) && 'left-to-right' !== $attributes['collapseOrder'] && in_array( $mobile_layout, $collapse_layouts ) ) {
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . $item_count . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . $item_count . ')' );
$css->add_property( 'order', ( $columns - $item_count + 1 ) );
}
// Row Two.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 11 ) );
}
// Row Three.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 21 ) );
}
// Row Four.
foreach ( range( 1, $columns ) as $item_count ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(' . ( $item_count + $columns + $columns + $columns ) . ')' );
$css->add_property( 'order', ( $columns - $item_count + 31 ) );
}
}
Expand Down Expand Up @@ -702,55 +702,55 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
$css->set_media_state( 'desktopOnly' );
}
if ( ( isset( $attributes['breakoutLeft'] ) && true === $attributes['breakoutLeft'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(1)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(1)' );
$css->add_property( 'margin-inline-start', 'calc( ' . $padding_left . ' *-1 )' );
}
if ( ( isset( $attributes['breakoutRight'] ) && true === $attributes['breakoutRight'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(2)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(2)' );
$css->add_property( 'margin-inline-end', 'calc( ' . $padding_right . ' *-1 )' );
}
$css->set_media_state( 'desktop' );
if ( apply_filters( 'kadence_blocks_css_output_media_queries', true ) ) {
if ( isset( $content_width ) && ! empty( $content_width ) ) {
$css->start_media_query( '(min-width:' . absint( $content_width ) . 'px)' );
if ( ( isset( $attributes['breakoutLeft'] ) && true === $attributes['breakoutLeft'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(1):not(.specificity)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(1):not(.specificity)' );
$css->add_property( 'margin-inline-start', 'var(--breakout-negative-margin-left)' );
}
if ( ( isset( $attributes['breakoutRight'] ) && true === $attributes['breakoutRight'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(2):not(.specificity)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(2):not(.specificity)' );
$css->add_property( 'margin-inline-end', 'var(--breakout-negative-margin-right)' );
}
$css->stop_media_query();
} else {
$css->set_media_state( 'desktopOnly' );
if ( ( isset( $attributes['breakoutLeft'] ) && true === $attributes['breakoutLeft'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(1)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(1)' );
$css->add_property( 'margin-inline-start', 'var(--breakout-negative-margin-left)' );
}
if ( ( isset( $attributes['breakoutRight'] ) && true === $attributes['breakoutRight'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(2)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(2)' );
$css->add_property( 'margin-inline-end', 'var(--breakout-negative-margin-right)' );
}
$css->set_media_state( 'desktop' );
}
} else {
if ( ( isset( $attributes['breakoutLeft'] ) && true === $attributes['breakoutLeft'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(1):not(.specificity)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(1):not(.specificity)' );
$css->add_property( 'margin-inline-start', 'var(--breakout-negative-margin-left, calc( ' . $padding_left . ' *-1 ) )' );
}
if ( ( isset( $attributes['breakoutRight'] ) && true === $attributes['breakoutRight'] ) ) {
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-child(2):not(.specificity)' );
$css->set_selector( $inner_selector . ' > .wp-block-kadence-column:nth-of-type(2):not(.specificity)' );
$css->add_property( 'margin-inline-end', 'var(--breakout-negative-margin-right, calc( ' . $padding_right . ' *-1 ))' );
}
}
$css->set_media_state( 'tabletOnly' );
if ( ( isset( $attributes['breakoutLeft'] ) && true === $attributes['breakoutLeft'] ) ) {
$css->set_selector( $inner_selector . ':not(.kt-tab-layout-row) > .wp-block-kadence-column:nth-child(1)' );
$css->set_selector( $inner_selector . ':not(.kt-tab-layout-row) > .wp-block-kadence-column:nth-of-type(1)' );
$css->add_property( 'margin-inline-start', 'calc( ' . $padding_left . ' *-1 )' );
}
if ( ( isset( $attributes['breakoutRight'] ) && true === $attributes['breakoutRight'] ) ) {
$css->set_selector( $inner_selector . ':not(.kt-tab-layout-row) > .wp-block-kadence-column:nth-child(2)' );
$css->set_selector( $inner_selector . ':not(.kt-tab-layout-row) > .wp-block-kadence-column:nth-of-type(2)' );
$css->add_property( 'margin-inline-end', 'calc( ' . $padding_right . ' *-1 )' );
}
$css->set_media_state( 'desktop' );
Expand Down
Loading