Skip to content

Commit 8d077ad

Browse files
committed
fix #778
1 parent 9929689 commit 8d077ad

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

App/Setup/Blocks.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function ( $block_content, $block ) {
2626
if ( isset( $block['attrs']['smb']['flexGrow'] ) ) {
2727
$style = $p->get_attribute( 'style' );
2828
$property = '--smb--flex-grow:';
29-
if ( $style && false === strpos( $style, $property ) ) {
29+
if ( ! $style || false === strpos( $style, $property ) ) {
3030
$style = $style ? $style . ';' : $style;
3131
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['flexGrow'] ) );
3232
}
@@ -36,7 +36,7 @@ function ( $block_content, $block ) {
3636
if ( isset( $block['attrs']['smb']['flexShrink'] ) ) {
3737
$style = $p->get_attribute( 'style' );
3838
$property = '--smb--flex-shrink:';
39-
if ( $style && false === strpos( $style, $property ) ) {
39+
if ( ! $style || false === strpos( $style, $property ) ) {
4040
$style = $style ? $style . ';' : $style;
4141
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['flexShrink'] ) );
4242
}
@@ -46,7 +46,7 @@ function ( $block_content, $block ) {
4646
if ( isset( $block['attrs']['smb']['flexBasis'] ) ) {
4747
$style = $p->get_attribute( 'style' );
4848
$property = '--smb--flex-basis:';
49-
if ( $style && false === strpos( $style, $property ) ) {
49+
if ( ! $style || false === strpos( $style, $property ) ) {
5050
$style = $style ? $style . ';' : $style;
5151
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['flexBasis'] ) );
5252
}
@@ -56,7 +56,7 @@ function ( $block_content, $block ) {
5656
if ( isset( $block['attrs']['smb']['justifySelf'] ) ) {
5757
$style = $p->get_attribute( 'style' );
5858
$property = '--smb--justify-self:';
59-
if ( $style && false === strpos( $style, $property ) ) {
59+
if ( ! $style || false === strpos( $style, $property ) ) {
6060
$style = $style ? $style . ';' : $style;
6161
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['justifySelf'] ) );
6262
}
@@ -66,7 +66,7 @@ function ( $block_content, $block ) {
6666
if ( isset( $block['attrs']['smb']['alignSelf'] ) ) {
6767
$style = $p->get_attribute( 'style' );
6868
$property = '--smb--align-self:';
69-
if ( $style && false === strpos( $style, $property ) ) {
69+
if ( ! $style || false === strpos( $style, $property ) ) {
7070
$style = $style ? $style . ';' : $style;
7171
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['alignSelf'] ) );
7272
}
@@ -76,7 +76,7 @@ function ( $block_content, $block ) {
7676
if ( isset( $block['attrs']['smb']['gridColumn'] ) ) {
7777
$style = $p->get_attribute( 'style' );
7878
$property = '--smb--grid-column:';
79-
if ( $style && false === strpos( $style, $property ) ) {
79+
if ( ! $style || false === strpos( $style, $property ) ) {
8080
$style = $style ? $style . ';' : $style;
8181
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['gridColumn'] ) );
8282
}
@@ -86,7 +86,7 @@ function ( $block_content, $block ) {
8686
if ( isset( $block['attrs']['smb']['gridRow'] ) ) {
8787
$style = $p->get_attribute( 'style' );
8888
$property = '--smb--grid-row:';
89-
if ( $style && false === strpos( $style, $property ) ) {
89+
if ( ! $style || false === strpos( $style, $property ) ) {
9090
$style = $style ? $style . ';' : $style;
9191
$p->set_attribute( 'style', trim( $style . $property . $block['attrs']['smb']['gridRow'] ) );
9292
}

0 commit comments

Comments
 (0)