revert: temporarily undo <details> optimization because firefox doesn't support it
This commit is contained in:
2 files changed
+46
-43
No files matched your search
@@ -116,15 +116,15 @@
|
|||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<details
|
<li
|
||||||
class={['py-3 relative comment', clazz]}
|
class={['py-3 relative', clazz]}
|
||||||
id={node.comment_view.comment.id.toString()}
|
id={node.comment_view.comment.id.toString()}
|
||||||
bind:open
|
|
||||||
>
|
>
|
||||||
{#if meta}
|
{#if meta}
|
||||||
{@const creatorIsOp =
|
{@const creatorIsOp =
|
||||||
node.comment_view.creator.id == node.comment_view.post.creator_id}
|
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"
|
class="flex flex-row cursor-pointer gap-2 items-center group text-sm flex-wrap w-full z-0 group relative"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@@ -247,9 +247,15 @@
|
|||||||
#{node.comment_view.comment.id}
|
#{node.comment_view.comment.id}
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</summary>
|
</label>
|
||||||
{/if}
|
{/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 id="comment-content">
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
@@ -304,25 +310,22 @@
|
|||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</li>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.comment {
|
.expand {
|
||||||
interpolate-size: allow-keywords;
|
display: grid;
|
||||||
}
|
grid-template-rows: 0fr;
|
||||||
|
grid-template-columns: 100%;
|
||||||
.comment::details-content {
|
|
||||||
height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition:
|
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment[open]::details-content {
|
.comment-expand:checked + .expand {
|
||||||
height: auto;
|
grid-template-rows: 1fr;
|
||||||
opacity: 1;
|
}
|
||||||
|
|
||||||
|
.expand > * {
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -18,40 +18,40 @@
|
|||||||
children,
|
children,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
|
const id = $props.id()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<details {...rest} class={['w-full relative disclosure', clazz]} bind:open>
|
<div {...rest} class={['w-full relative', clazz]}>
|
||||||
<summary class="discosure-summary">
|
<label for={id} class="w-full">
|
||||||
{@render summary?.({ open })}
|
{@render summary?.({ open })}
|
||||||
</summary>
|
</label>
|
||||||
{@render extended?.()}
|
{@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 })}
|
{@render children?.({ open })}
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.disclosure {
|
.expand {
|
||||||
interpolate-size: allow-keywords;
|
display: grid;
|
||||||
will-change: height;
|
grid-template-rows: 0fr;
|
||||||
}
|
grid-template-columns: 100%;
|
||||||
|
|
||||||
.disclosure::details-content {
|
|
||||||
height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition:
|
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.disclosure[open]::details-content {
|
input:checked + .expand {
|
||||||
height: auto;
|
grid-template-rows: 1fr;
|
||||||
opacity: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
summary {
|
.expand > :global(*) {
|
||||||
list-style: none;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user