From 9f2c27d429ef464f66c5e1a3c1f68b755ad18100 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 7 Apr 2024 00:04:58 -0700 Subject: [PATCH] style: update mobile ToC styling --- src/lib/components/Blog/Article.svelte | 37 +++++++++--------- src/lib/components/Toc/MobileToc.svelte | 40 +++++++++++++++++++ src/lib/components/Toc/StickyToc.svelte | 2 +- src/routes/blog/[year]/[slug]/+page.svelte | 45 +++------------------- 4 files changed, 65 insertions(+), 59 deletions(-) create mode 100644 src/lib/components/Toc/MobileToc.svelte diff --git a/src/lib/components/Blog/Article.svelte b/src/lib/components/Blog/Article.svelte index dbc9593..382cacd 100644 --- a/src/lib/components/Blog/Article.svelte +++ b/src/lib/components/Blog/Article.svelte @@ -1,7 +1,6 @@ @@ -12,23 +11,25 @@
{doc.title}
-
-

- {doc.title} -

- {#if doc.description} -

- {doc.description} -

- {/if} - - +
+
+

+ {doc.title} +

+ {#if doc.description} +

+ {doc.description} +

+ {/if} + +
+
diff --git a/src/lib/components/Toc/MobileToc.svelte b/src/lib/components/Toc/MobileToc.svelte new file mode 100644 index 0000000..5bc0ceb --- /dev/null +++ b/src/lib/components/Toc/MobileToc.svelte @@ -0,0 +1,40 @@ + + + + + + + +

On this page

+
+ + {#if $tocStore.items.size} +
    + {#each $tocStore.items.values() as tocItem} +
  1. + + +
  2. + {/each} +
+ {/if} +
+
+
+
+
diff --git a/src/lib/components/Toc/StickyToc.svelte b/src/lib/components/Toc/StickyToc.svelte index 19dc85c..10e636e 100644 --- a/src/lib/components/Toc/StickyToc.svelte +++ b/src/lib/components/Toc/StickyToc.svelte @@ -14,7 +14,7 @@ -

On this page

+

On this page

{#if $tocStore.items.size} diff --git a/src/routes/blog/[year]/[slug]/+page.svelte b/src/routes/blog/[year]/[slug]/+page.svelte index e361590..253eba0 100644 --- a/src/routes/blog/[year]/[slug]/+page.svelte +++ b/src/routes/blog/[year]/[slug]/+page.svelte @@ -1,14 +1,9 @@ @@ -55,32 +43,9 @@ }} >