Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide table of contents when printing #7

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib/Writing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{/snippet}

{#if headings.length > 0}
<div class="fixed inset-y-0 right-0 hidden max-w-56 flex-none pr-8 xl:block">
<div class="fixed inset-y-0 right-0 hidden max-w-56 flex-none pr-8 xl:block print:hidden">
<div class="top-4 flex max-h-screen flex-col justify-between overflow-y-auto pb-6 pt-10">
<div class="mb-8 space-y-4">
{@render toc(headings)}
Expand All @@ -86,7 +86,7 @@
<span class="shrink">{title}</span>
{#if headings.length > 0}
<button
class="shrink-0 cursor-pointer rounded border border-zinc-300 p-1 hover:bg-zinc-200 xl:hidden dark:border-zinc-700 dark:hover:bg-zinc-800"
class="shrink-0 cursor-pointer rounded border border-zinc-300 p-1 hover:bg-zinc-200 xl:hidden dark:border-zinc-700 dark:hover:bg-zinc-800 print:hidden"
onclick={() => (open = !open)}
aria-label="Open table of contents."
>
Expand All @@ -105,7 +105,7 @@
</div>

{#if open}
<div class="mt-1 space-y-2 pt-2 xl:hidden">
<div class="mt-1 space-y-2 pt-2 xl:hidden print:hidden">
{@render toc(headings)}
</div>
{/if}
Expand Down
Loading