Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/adv-form-number-field-required-message
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh authored Feb 21, 2024
2 parents 1eef272 + ea85159 commit 0068460
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 82 deletions.
3 changes: 3 additions & 0 deletions includes/blocks/class-kadence-blocks-icon-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
'mobile_key' => 'mobileTextAlignment',
);
$css->render_flex_align( $attributes, 'textAlignment', $align_args );
if( isset($attributes['wrapIcons'] ) && $attributes['wrapIcons'] ) {
$css->add_property('flex-wrap', 'wrap');
}
$css->render_gap( $attributes );

return $css->css_output();
Expand Down
8 changes: 4 additions & 4 deletions includes/blocks/class-kadence-blocks-icon-list-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {

$list_gap_props = array(
'listGap' => array(
0 => ! empty( $attributes['listGap'] ) ? $attributes['listGap'] : '5',
1 => ! empty( $attributes['tabletListGap'] ) ? $attributes['tabletListGap'] : ( ! empty( $attributes['listGap'] ) ? $attributes['listGap'] : '' ),
2 => ! empty( $attributes['mobileListGap'] ) ? $attributes['mobileListGap'] : ( ! empty( $attributes['tabletListGap'] ) ? $attributes['tabletListGap'] : ( ! empty( $attributes['listGap'] ) ? $attributes['listGap'] : '' ) ),
),
0 => isset( $attributes['listGap'] ) ? $attributes['listGap'] : '5',
1 => isset( $attributes['tabletListGap'] ) ? $attributes['tabletListGap'] : '',
2 => isset( $attributes['mobileListGap'] ) ? $attributes['mobileListGap'] : '',
)
);

$css->set_selector( '.wp-block-kadence-iconlist.kt-svg-icon-list-items' . $unique_id . ' ul.kt-svg-icon-list' );
Expand Down
6 changes: 3 additions & 3 deletions includes/blocks/class-kadence-blocks-infobox-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,18 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
}
}
if ( ! empty( $media_icon['size'] ) ) {
$css->set_selector( $base_selector . ' .kt-info-svg-icon, ' . $base_selector . ' .kt-info-svg-icon-flip, ' . $base_selector . ' .kt-blocks-info-box-number' );
$css->set_selector( $base_selector . ' .kadence-info-box-icon-container .kt-info-svg-icon, ' . $base_selector . ' .kt-info-svg-icon-flip, ' . $base_selector . ' .kt-blocks-info-box-number' );
$css->add_property( 'font-size', $media_icon['size'] . 'px' );
}
if ( isset( $media_icon['tabletSize'] ) && is_numeric( $media_icon['tabletSize'] ) ) {
$css->set_media_state( 'tablet' );
$css->set_selector( $base_selector . ' .kt-info-svg-icon, ' . $base_selector . ' .kt-info-svg-icon-flip, ' . $base_selector . ' .kt-blocks-info-box-number' );
$css->set_selector( $base_selector . ' .kadence-info-box-icon-container .kt-info-svg-icon, ' . $base_selector . ' .kt-info-svg-icon-flip, ' . $base_selector . ' .kt-blocks-info-box-number' );
$css->add_property( 'font-size', $media_icon['tabletSize'] . 'px' );
$css->set_media_state( 'desktop' );
}
if ( isset( $media_icon['mobileSize'] ) && is_numeric( $media_icon['mobileSize'] ) ) {
$css->set_media_state( 'mobile' );
$css->set_selector( $base_selector . ' .kt-info-svg-icon, ' . $base_selector . ' .kt-info-svg-icon-flip, ' . $base_selector . ' .kt-blocks-info-box-number' );
$css->set_selector( $base_selector . ' .kadence-info-box-icon-container .kt-info-svg-icon, ' . $base_selector . ' .kt-info-svg-icon-flip, ' . $base_selector . ' .kt-blocks-info-box-number' );
$css->add_property( 'font-size', $media_icon['mobileSize'] . 'px' );
$css->set_media_state( 'desktop' );
}
Expand Down
1 change: 0 additions & 1 deletion includes/blocks/class-kadence-blocks-single-icon-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static function get_instance() {
* @param string $unique_style_id the blocks alternate ID for queries.
*/
public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {

$css->set_style_id( 'kb-' . $this->block_name . $unique_style_id );
if ( isset( $attributes ) && is_array( $attributes ) ) {
$css->set_selector( '.kt-svg-item-' . $unique_id . ' .kb-svg-icon-wrap' );
Expand Down
6 changes: 3 additions & 3 deletions includes/class-kadence-blocks-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -1707,14 +1707,14 @@ public function render_responsive_range( $attributes, $name = 'width', $property
}
$unit = ! empty( $attributes[ $unit ] ) ? $attributes[ $unit ] : 'px';
if ( isset( $attributes[ $name ] ) && is_array( $attributes[ $name ] ) ) {
if ( ! empty( $attributes[ $name ][0] ) ) {
if ( isset( $attributes[ $name ][0] ) && is_numeric( $attributes[ $name ][0] ) ) {
$this->add_property( $property, $attributes[ $name ][0] . $unit );
}
if ( ! empty( $attributes[ $name ][1] ) ) {
if ( isset( $attributes[ $name ][1] ) && is_numeric( $attributes[ $name ][1] ) ){
$this->set_media_state( 'tablet' );
$this->add_property( $property, $attributes[ $name ][1] . $unit );
}
if ( ! empty( $attributes[ $name ][2] ) ) {
if ( isset( $attributes[ $name ][2] ) && is_numeric( $attributes[ $name ][2] ) ) {
$this->set_media_state( 'mobile' );
$this->add_property( $property, $attributes[ $name ][2] . $unit );
}
Expand Down
Loading

0 comments on commit 0068460

Please sign in to comment.