From d48ad7a6e524cb2a2e592071942bfd6bea0122f5 Mon Sep 17 00:00:00 2001 From: mxkae Date: Mon, 12 Jun 2023 21:30:37 +0800 Subject: [PATCH 1/6] added width property to stk block within stk inner blocks --- src/block/columns/style.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/block/columns/style.scss b/src/block/columns/style.scss index 7587a52ad..76ebad92a 100644 --- a/src/block/columns/style.scss +++ b/src/block/columns/style.scss @@ -8,6 +8,10 @@ max-width: none; } +.stk-inner-blocks > .stk-block { + width: inherit; +} + .stk-block-columns > .stk-block-content { --stk-column-gap: 0px; // For nested columns, this takes precedence. column-gap: var(--stk-column-gap, 0px); From 21a5b17bb19453104fbcd9ce7b283a19fbe209f0 Mon Sep 17 00:00:00 2001 From: mxkae Date: Thu, 15 Jun 2023 01:18:52 +0800 Subject: [PATCH 2/6] add width inherit when max content width is set --- src/block-components/helpers/size/style.js | 14 ++++++++++++++ src/block/columns/style.scss | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/block-components/helpers/size/style.js b/src/block-components/helpers/size/style.js index c45b9a87d..8b36a343c 100644 --- a/src/block-components/helpers/size/style.js +++ b/src/block-components/helpers/size/style.js @@ -53,6 +53,20 @@ const Styles = props => { responsive="all" hasUnits="px" /> + { + const blockWidth = getAttribute( 'width' ) + return blockWidth ? 'inherit' : '' + } } + /> .stk-block { - width: inherit; -} - .stk-block-columns > .stk-block-content { --stk-column-gap: 0px; // For nested columns, this takes precedence. column-gap: var(--stk-column-gap, 0px); From f93c474d15bf3fde22692ba231729fc3ae60485f Mon Sep 17 00:00:00 2001 From: mxkae Date: Thu, 15 Jun 2023 19:31:11 +0800 Subject: [PATCH 3/6] updated return value, fix issue for tablet/mobile --- src/block-components/helpers/size/style.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/block-components/helpers/size/style.js b/src/block-components/helpers/size/style.js index 8b36a343c..1df42a045 100644 --- a/src/block-components/helpers/size/style.js +++ b/src/block-components/helpers/size/style.js @@ -62,9 +62,9 @@ const Styles = props => { attrNameTemplate={ attrNameTemplate } responsive="all" hasUnits="px" - valueCallback={ ( value, getAttribute ) => { - const blockWidth = getAttribute( 'width' ) - return blockWidth ? 'inherit' : '' + valueCallback={ ( value, getAttribute, device ) => { + const blockWidth = getAttribute( 'width', device ) + return blockWidth ? 'inherit' : undefined } } /> Date: Fri, 16 Jun 2023 06:47:04 +0800 Subject: [PATCH 4/6] Update src/block-components/helpers/size/style.js [skip ci] --- src/block-components/helpers/size/style.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/block-components/helpers/size/style.js b/src/block-components/helpers/size/style.js index 1df42a045..1c2a8368a 100644 --- a/src/block-components/helpers/size/style.js +++ b/src/block-components/helpers/size/style.js @@ -61,7 +61,6 @@ const Styles = props => { key="width" attrNameTemplate={ attrNameTemplate } responsive="all" - hasUnits="px" valueCallback={ ( value, getAttribute, device ) => { const blockWidth = getAttribute( 'width', device ) return blockWidth ? 'inherit' : undefined From ed9d590a2ae04305123162adceb4dde0eca8ad28 Mon Sep 17 00:00:00 2001 From: mxkae Date: Mon, 19 Jun 2023 12:29:29 +0800 Subject: [PATCH 5/6] added css to address block max content width --- src/block-components/helpers/size/style.js | 13 ------------- src/block/columns/style.scss | 5 +++++ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/block-components/helpers/size/style.js b/src/block-components/helpers/size/style.js index 1c2a8368a..c45b9a87d 100644 --- a/src/block-components/helpers/size/style.js +++ b/src/block-components/helpers/size/style.js @@ -53,19 +53,6 @@ const Styles = props => { responsive="all" hasUnits="px" /> - { - const blockWidth = getAttribute( 'width', device ) - return blockWidth ? 'inherit' : undefined - } } - /> .stk-inner-blocks > .stk-block-column .stk-inner-blocks > .stk-block { + width: inherit; +} + .stk-block-columns > .stk-block-content { --stk-column-gap: 0px; // For nested columns, this takes precedence. column-gap: var(--stk-column-gap, 0px); From 4050247248ee5ca307bd158958087eda5f018312 Mon Sep 17 00:00:00 2001 From: mxkae Date: Tue, 20 Jun 2023 11:05:32 +0800 Subject: [PATCH 6/6] updated selector --- src/block/columns/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/block/columns/style.scss b/src/block/columns/style.scss index 89d78d931..05a847973 100644 --- a/src/block/columns/style.scss +++ b/src/block/columns/style.scss @@ -9,7 +9,7 @@ } // Make sure the blocks in inner columns have the correct width when max content width is set -.stk-block-columns > .stk-inner-blocks > .stk-block-column .stk-inner-blocks > .stk-block { +.stk-column-wrapper > .stk-inner-blocks > .stk-block { width: inherit; }