This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,15 @@ export default function Columns({
21
21
columnCount,
22
22
children,
23
23
style,
24
- verticalAlignment
24
+ verticalAlignment,
25
+ isStackedOnMobile
25
26
} ) {
26
27
return (
27
28
< div
28
29
id = { id || null }
29
30
className = { cn (
30
31
styles . columns ,
32
+ isStackedOnMobile && styles . columnStacked ,
31
33
columnCount && styles [ `columns-${ columnCount } ` ] ,
32
34
className ,
33
35
verticalAlignment === 'center' ? styles . alignCenter : null ,
Original file line number Diff line number Diff line change 1
1
.columns {
2
- @apply flex flex-row gap-8;
2
+ @apply flex gap-8;
3
+
4
+ & .columnStacked {
5
+ @apply flex-col md:flex-row;
6
+ }
3
7
4
8
& .alignCenter {
5
9
& .column {
18
22
}
19
23
20
24
& .column {
21
- @apply flex flex-col;
25
+ @apply flex flex-col w-full ;
22
26
23
27
& .hasBackground {
24
28
@apply p-4;
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ export default function BlockColumns({
28
28
innerBlocks,
29
29
style,
30
30
textColorHex,
31
- verticalAlignment
31
+ verticalAlignment,
32
+ isStackedOnMobile
32
33
} ) {
33
34
const columnsStyle = getBlockStyles ( {
34
35
backgroundColorHex,
@@ -46,14 +47,15 @@ export default function BlockColumns({
46
47
columnCount = { innerBlocks ?. length }
47
48
style = { columnsStyle }
48
49
verticalAlignment = { verticalAlignment }
50
+ isStackedOnMobile = { isStackedOnMobile }
49
51
>
50
52
{ innerBlocks . map ( ( { attributes, innerBlocks} , index ) => {
51
53
const columnStyle = getBlockStyles ( {
52
54
backgroundColorHex : attributes ?. backgroundColorHex ,
53
55
gradientHex : attributes ?. gradientHex ,
54
56
textColorHex : attributes ?. textColorHex ,
55
57
style : attributes ?. style ,
56
- width : attributes ?. width || '50%'
58
+ width : attributes ?. width
57
59
} )
58
60
59
61
return (
You can’t perform that action at this time.
0 commit comments