Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 63824f3

Browse files
committed
fixed column width
1 parent 4556fc1 commit 63824f3

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

components/atoms/Columns/Columns.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ export default function Columns({
2121
columnCount,
2222
children,
2323
style,
24-
verticalAlignment
24+
verticalAlignment,
25+
isStackedOnMobile
2526
}) {
2627
return (
2728
<div
2829
id={id || null}
2930
className={cn(
3031
styles.columns,
32+
isStackedOnMobile && styles.columnStacked,
3133
columnCount && styles[`columns-${columnCount}`],
3234
className,
3335
verticalAlignment === 'center' ? styles.alignCenter : null,

components/atoms/Columns/Columns.module.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.columns {
2-
@apply flex flex-row gap-8;
2+
@apply flex gap-8;
3+
4+
&.columnStacked {
5+
@apply flex-col md:flex-row;
6+
}
37

48
&.alignCenter {
59
& .column {
@@ -18,7 +22,7 @@
1822
}
1923

2024
& .column {
21-
@apply flex flex-col;
25+
@apply flex flex-col w-full;
2226

2327
&.hasBackground {
2428
@apply p-4;

components/blocks/core/BlockColumns/BlockColumns.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default function BlockColumns({
2828
innerBlocks,
2929
style,
3030
textColorHex,
31-
verticalAlignment
31+
verticalAlignment,
32+
isStackedOnMobile
3233
}) {
3334
const columnsStyle = getBlockStyles({
3435
backgroundColorHex,
@@ -46,14 +47,15 @@ export default function BlockColumns({
4647
columnCount={innerBlocks?.length}
4748
style={columnsStyle}
4849
verticalAlignment={verticalAlignment}
50+
isStackedOnMobile={isStackedOnMobile}
4951
>
5052
{innerBlocks.map(({attributes, innerBlocks}, index) => {
5153
const columnStyle = getBlockStyles({
5254
backgroundColorHex: attributes?.backgroundColorHex,
5355
gradientHex: attributes?.gradientHex,
5456
textColorHex: attributes?.textColorHex,
5557
style: attributes?.style,
56-
width: attributes?.width || '50%'
58+
width: attributes?.width
5759
})
5860

5961
return (

0 commit comments

Comments
 (0)