Skip to content

Commit 59a10b8

Browse files
committed
remove PagesWrapper 100vh, make Toc sticky on desktop up
1 parent a39f573 commit 59a10b8

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

src/lib/components/atoms/PagesWrapper.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
3737
@include for-desktop-up {
3838
.layout {
39-
height: 100vh;
4039
flex-direction: row;
4140
gap: 4rem;
4241
}

src/lib/components/atoms/Toc.svelte

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,23 @@
5050
});
5151
</script>
5252

53-
<div class="lg:overflow-y-auto rounded-lg text-white">
53+
<div>
5454
<nav>
5555
{#key $headingsTree}
5656
<Tree tree={$headingsTree} activeHeadingIdxs={$activeHeadingIdxs} {item} />
5757
{/key}
5858
</nav>
5959
</div>
60+
61+
<style lang="scss">
62+
@import '$lib/scss/breakpoints.scss';
63+
64+
@include for-desktop-up {
65+
nav {
66+
position: sticky;
67+
top: 0;
68+
z-index: 100;
69+
background-color: inherit;
70+
}
71+
}
72+
</style>

src/lib/components/atoms/Tree.svelte

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
href="#{heading.id}"
1616
use:melt={$item(heading.id)}
1717
class="inline-flex items-center justify-center gap-1 text-white no-underline transition-colors
18-
hover:text-[rgba(255,_49,_0,_1)] data-[active]:text-[rgba(255,_49,_0,_1)]"
18+
hover:text-[rgba(255,_49,_0,_1)] data-[active]:text-[rgba(255,_49,_0,_1)] break-keep"
1919
>
20-
<!--
21-
Along with the heading title, the original heading node
20+
<!-- Along with the heading title, the original heading node
2221
is also passed down, so you can display headings
23-
however you want.
24-
-->
22+
however you want. -->
2523
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
2624
{@html heading.node.innerHTML}
2725
</a>
@@ -32,9 +30,3 @@
3230
{/each}
3331
{/if}
3432
</ul>
35-
36-
<style>
37-
a {
38-
word-break: keep-all;
39-
}
40-
</style>

src/routes/(pages)/about/+page.svelte

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,13 @@
337337
padding-top: 2rem;
338338
}
339339
340+
@include for-desktop-up {
341+
.content-preview {
342+
overflow-y: auto;
343+
padding-top: 0rem;
344+
}
345+
}
346+
340347
#toc-builder-preview > h2 {
341348
font-size: 1.8rem;
342349
font-weight: bold;
@@ -371,7 +378,6 @@
371378
margin: 0;
372379
padding-left: 1.5rem;
373380
word-break: keep-all;
374-
padding-top: 1rem;
375381
}
376382
377383
ul li {
@@ -393,13 +399,4 @@
393399
img {
394400
border-radius: 24px;
395401
}
396-
397-
@include for-desktop-up {
398-
.content-preview {
399-
overflow-y: scroll;
400-
scrollbar-width: none;
401-
-ms-overflow-style: none;
402-
padding-top: 0rem;
403-
}
404-
}
405402
</style>

0 commit comments

Comments
 (0)