Skip to content

Commit 3279aa2

Browse files
authored
Updates to style less tiers in group (#209)
* Updates to style less tiers in group * Cleanup
1 parent 3cf0ebe commit 3279aa2

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

components/Block/TierGroup.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,22 @@ const { data: block, refresh } = useAsyncData(props.uuid, () =>
1515
),
1616
);
1717
18+
const tierCount = computed(() => block.value?.tiers?.length ?? 0);
19+
20+
const tierCountClass = computed(() => {
21+
if (tierCount.value === 1) return 'single-tier';
22+
if (tierCount.value === 2) return 'two-tiers';
23+
return null;
24+
});
25+
1826
autoApply(`[data-block-id="${props.uuid}"]`, refresh);
1927
</script>
2028

2129
<template>
2230
<div
2331
v-if="block"
2432
class="block-tier-group"
33+
:class="tierCountClass"
2534
:data-block-id="props.uuid"
2635
:data-directus="
2736
isVisualEditingEnabled
@@ -48,7 +57,19 @@ autoApply(`[data-block-id="${props.uuid}"]`, refresh);
4857
@media (width > 64rem) {
4958
.block-tier-group {
5059
grid-template-columns: repeat(3, 1fr);
51-
padding: 0;
60+
}
61+
62+
.block-tier-group.single-tier {
63+
grid-template-columns: 1fr;
64+
max-width: 28rem;
65+
margin-inline: auto;
66+
}
67+
68+
.block-tier-group.two-tiers {
69+
grid-template-columns: repeat(2, minmax(0, 28rem));
70+
max-width: fit-content;
71+
margin-inline: auto;
72+
gap: var(--space-8);
5273
}
5374
}
5475
</style>

0 commit comments

Comments
 (0)