Skip to content

Commit e18467a

Browse files
committed
fix
1 parent 30b9020 commit e18467a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

apps/svelte.dev/src/routes/packages/Category.svelte

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
let { title, description, packages }: Props = $props();
1212
1313
const INITIAL_ITEMS = 3;
14-
let showAll = $state(false);
1514
</script>
1615

1716
<section class="category">
@@ -38,9 +37,8 @@
3837
<span class="icon"></span>
3938
</span>
4039

41-
<span>
42-
{showAll ? 'show less' : `show all (${packages.length})`}
43-
</span>
40+
<span class="show-more">show all ({packages.length})</span>
41+
<span class="show-less">show less</span>
4442
</summary>
4543

4644
<div class="grid">
@@ -101,6 +99,22 @@
10199
width: 100%;
102100
justify-content: flex-end;
103101
102+
.show-more {
103+
display: block;
104+
105+
[open] & {
106+
display: none;
107+
}
108+
}
109+
110+
.show-less {
111+
display: none;
112+
113+
[open] & {
114+
display: block;
115+
}
116+
}
117+
104118
.icon {
105119
mask-size: 2rem;
106120
mask-image: url(icons/plus);

0 commit comments

Comments
 (0)