Skip to content

Commit 3d34732

Browse files
authored
Fix Columns text alignment and order (#207)
1 parent f3e8e66 commit 3d34732

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

components/Block/Columns.vue

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ const { data: block, refresh } = useAsyncData(props.uuid, () =>
2424
2525
const fillBlocks = ['block_quote', 'block_code'];
2626
27-
const hasMedia = (blocks: Array<{ collection: string }>) => {
28-
return blocks?.some((block) => block.collection === 'block_media') ?? false;
29-
};
30-
31-
const colAHasMedia = computed(() => hasMedia(block.value?.col_a ?? []));
32-
const colBHasMedia = computed(() => hasMedia(block.value?.col_b ?? []));
33-
3427
autoApply(`[data-block-id="${props.uuid}"]`, refresh);
3528
</script>
3629

@@ -51,7 +44,7 @@ autoApply(`[data-block-id="${props.uuid}"]`, refresh);
5144
: undefined
5245
"
5346
>
54-
<div class="column" :class="{ 'has-media': colAHasMedia }">
47+
<div class="column">
5548
<BaseBlock
5649
v-for="row in block.col_a"
5750
:key="row.id"
@@ -61,7 +54,7 @@ autoApply(`[data-block-id="${props.uuid}"]`, refresh);
6154
/>
6255
</div>
6356

64-
<div class="column" :class="{ 'has-media': colBHasMedia }">
57+
<div class="column">
6558
<BaseBlock
6659
v-for="row in block.col_b"
6760
:key="row.id"
@@ -101,6 +94,7 @@ autoApply(`[data-block-id="${props.uuid}"]`, refresh);
10194
grid-column: auto / span 2;
10295
display: flex;
10396
flex-direction: column;
97+
justify-content: center;
10498
gap: var(--space-4);
10599
106100
.fill {
@@ -111,18 +105,8 @@ autoApply(`[data-block-id="${props.uuid}"]`, refresh);
111105
gap: var(--space-8);
112106
}
113107
114-
// On mobile, reorder so text appears above media
115-
@container (width <= 50rem) {
116-
order: 1;
117-
118-
&.has-media {
119-
order: 2;
120-
}
121-
}
122-
123108
@container (width > 50rem) {
124109
grid-column: auto / span 1;
125-
order: unset;
126110
127111
&:first-child {
128112
--column-inset-inline-end: var(--space-10);

0 commit comments

Comments
 (0)