impr: use label for comment expand
This commit is contained in:
1 file changed
+11
-5
@@ -125,8 +125,8 @@
|
|||||||
id={node.comment_view.comment.id.toString()}
|
id={node.comment_view.comment.id.toString()}
|
||||||
>
|
>
|
||||||
{#if meta}
|
{#if meta}
|
||||||
<button
|
<label
|
||||||
onclick={() => (open = !open)}
|
for="comment-expand-{node.comment_view.comment.id}"
|
||||||
class="flex flex-row cursor-pointer gap-2 items-center group text-sm flex-wrap w-full z-0 group relative"
|
class="flex flex-row cursor-pointer gap-2 items-center group text-sm flex-wrap w-full z-0 group relative"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -218,9 +218,15 @@
|
|||||||
#{node.comment_view.comment.id}
|
#{node.comment_view.comment.id}
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</label>
|
||||||
{/if}
|
{/if}
|
||||||
<div class={['expand max-w-full', open && 'open', contentClass]}>
|
<input
|
||||||
|
class="hidden comment-expand"
|
||||||
|
type="checkbox"
|
||||||
|
id="comment-expand-{node.comment_view.comment.id}"
|
||||||
|
bind:checked={open}
|
||||||
|
/>
|
||||||
|
<div class={['expand max-w-full', contentClass]}>
|
||||||
<div id="comment-content">
|
<div id="comment-content">
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
@@ -286,7 +292,7 @@
|
|||||||
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.expand.open {
|
.comment-expand:checked + .expand {
|
||||||
grid-template-rows: 1fr;
|
grid-template-rows: 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user