Skip to content

Commit a90ec6b

Browse files
authored
feat: make playgrounds section collapsible (#1813)
1 parent 8a3c2ea commit a90ec6b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

app/components/CollapsibleSection.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ useHead({
7171
innerHTML: `
7272
:root[data-collapsed~='${props.id}'] section[data-anchor-id='${props.id}'] .collapsible-content {
7373
grid-template-rows: 0fr;
74+
overflow: hidden;
7475
}`,
7576
},
7677
],
@@ -121,7 +122,7 @@ useHead({
121122

122123
<div
123124
:id="contentId"
124-
class="grid ms-6 grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-in-out collapsible-content overflow-hidden"
125+
class="grid ms-6 grid-rows-[1fr] transition-[grid-template-rows] duration-200 ease-in-out collapsible-content"
125126
:inert="!isOpen"
126127
>
127128
<div class="min-h-0 min-w-0">

app/components/Package/Playgrounds.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ function focusMenuItem(index: number) {
118118
</script>
119119

120120
<template>
121-
<section v-if="links.length > 0" class="px-1">
122-
<h2 id="playgrounds-heading" class="text-xs font-mono text-fg uppercase tracking-wider mb-3">
123-
{{ $t('package.playgrounds.title') }}
124-
</h2>
125-
121+
<CollapsibleSection
122+
v-if="links.length > 0"
123+
id="playgrounds"
124+
:title="$t('package.playgrounds.title')"
125+
>
126126
<div ref="dropdownRef" class="relative">
127127
<!-- Single link: direct button -->
128128
<TooltipApp v-if="hasSingleLink && firstLink" :text="firstLink.providerName" class="w-full">
@@ -198,5 +198,5 @@ function focusMenuItem(index: number) {
198198
</div>
199199
</Transition>
200200
</div>
201-
</section>
201+
</CollapsibleSection>
202202
</template>

0 commit comments

Comments
 (0)