revert: temporarily undo <details> optimization because firefox doesn't support it

This commit is contained in:
Xylight committed 2026-07-15 13:48:16 -07:00
1 parent c18902a4c7
commit 9b40ede2d4
2 files changed
+46 -43

No files matched your search

+24 -21
View File
@@ -116,15 +116,15 @@
</Modal>
{/if}
<details
class={['py-3 relative comment', clazz]}
<li
class={['py-3 relative', clazz]}
id={node.comment_view.comment.id.toString()}
bind:open
>
{#if meta}
{@const creatorIsOp =
node.comment_view.creator.id == node.comment_view.post.creator_id}
<summary
<label
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"
>
<div
@@ -247,9 +247,15 @@
#{node.comment_view.comment.id}
</span>
{/if}
</summary>
</label>
{/if}
<div class={['max-w-full', contentClass]}>
<input
class="appearance-none absolute top-0 left-0 h-8 w-full pointer-events-none comment-expand"
type="checkbox"
id="comment-expand-{node.comment_view.comment.id}"
bind:checked={open}
/>
<div class={['expand max-w-full', contentClass]} inert={!open}>
<div id="comment-content">
<div
class={[
@@ -304,25 +310,22 @@
{@render children?.()}
</div>
</div>
</details>
</li>
<style>
.comment {
interpolate-size: allow-keywords;
}
.comment::details-content {
height: 0;
opacity: 0;
.expand {
display: grid;
grid-template-rows: 0fr;
grid-template-columns: 100%;
overflow: hidden;
transition:
height 0.5s cubic-bezier(0.19, 1, 0.22, 1),
opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1),
content-visibility 0.4s allow-discrete;
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.comment[open]::details-content {
height: auto;
opacity: 1;
.comment-expand:checked + .expand {
grid-template-rows: 1fr;
}
.expand > * {
min-height: 0;
}
</style>
+22 -22
View File
@@ -18,40 +18,40 @@
children,
...rest
}: Props = $props()
const id = $props.id()
</script>
<details {...rest} class={['w-full relative disclosure', clazz]} bind:open>
<summary class="discosure-summary">
<div {...rest} class={['w-full relative', clazz]}>
<label for={id} class="w-full">
{@render summary?.({ open })}
</summary>
</label>
{@render extended?.()}
<div class="expand">
<input
{id}
class="appearance-none absolute w-full h-full inset-0 pointer-events-none"
type="checkbox"
bind:checked={open}
/>
<div class="expand" inert={!open}>
{@render children?.({ open })}
</div>
</details>
</div>
<style>
.disclosure {
interpolate-size: allow-keywords;
will-change: height;
}
.disclosure::details-content {
height: 0;
opacity: 0;
.expand {
display: grid;
grid-template-rows: 0fr;
grid-template-columns: 100%;
overflow: hidden;
transition:
height 0.5s cubic-bezier(0.19, 1, 0.22, 1),
opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1),
content-visibility 0.4s allow-discrete;
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.disclosure[open]::details-content {
height: auto;
opacity: 1;
input:checked + .expand {
grid-template-rows: 1fr;
}
summary {
list-style: none;
.expand > :global(*) {
min-height: 0;
}
</style>