Skip to content

Commit 1d760ab

Browse files
committed
fix: needless whitespace on docs page and broken scrollbars on edge
1 parent f638615 commit 1d760ab

File tree

7 files changed

+5473
-6654
lines changed

7 files changed

+5473
-6654
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ Thumbs.db
1919
# Vite
2020
vite.config.js.timestamp-*
2121
vite.config.ts.timestamp-*
22+
23+
# Yarn
24+
.yarn/*
25+
!.yarn/patches
26+
!.yarn/plugins
27+
!.yarn/releases
28+
!.yarn/sdks
29+
!.yarn/versions
30+
.pnp.*
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
diff --git a/client/components/layout/KitDocsLayout.svelte b/client/components/layout/KitDocsLayout.svelte
2+
index 273f8f7a8865dfdbda7caec7e45592e7406acecc..e9c8921d52fb7cb2a4f773c0639f6d05c37ba325 100644
3+
--- a/client/components/layout/KitDocsLayout.svelte
4+
+++ b/client/components/layout/KitDocsLayout.svelte
5+
@@ -37,6 +37,8 @@ const { activeCategory, allLinks: sidebarLinks, activeLink, nextLink, previousLi
6+
$: collapseNavbar = $isLargeScreen ? false : $scrollTop > 60 && $scrollDirection === 'down';
7+
$: showSidebar = $sidebarLinks.length > 0;
8+
$: showBottomNav = showSidebar || $activeLink;
9+
+$: filteredHeaders = ($kitDocs.meta?.headers ?? []).filter(({ level }) => level > 1);
10+
+$: hasOnThisPageContent = filteredHeaders.length > 1 || filteredHeaders[0]?.children?.length > 0;
11+
</script>
12+
13+
<div
14+
@@ -196,7 +198,7 @@ $: showBottomNav = showSidebar || $activeLink;
15+
)}
16+
style={clsx(
17+
`max-width: ${
18+
- $kitDocs.meta
19+
+ hasOnThisPageContent && $kitDocs.meta
20+
? 'var(--kd-main-max-width, var(--kd-article-max-width))'
21+
: 'var(--kd-main-max-width)'
22+
};`,
23+
@@ -205,7 +207,10 @@ $: showBottomNav = showSidebar || $activeLink;
24+
<slot name="main-top" />
25+
26+
{#if $kitDocs.meta}
27+
- <article class="markdown prose dark:prose-invert z-10 max-w-[var(--kd-article-max-width)]">
28+
+ <article class={clsx(
29+
+ 'markdown prose dark:prose-invert z-10',
30+
+ hasOnThisPageContent && 'max-w-[var(--kd-article-max-width)]',
31+
+ )}>
32+
{#if $activeCategory && $activeCategory !== '.'}
33+
<p class="text-brand mb-3.5 text-[15px] font-semibold leading-6">
34+
{$activeCategory}
35+
@@ -255,15 +260,17 @@ $: showBottomNav = showSidebar || $activeLink;
36+
<slot name="main-bottom" />
37+
</main>
38+
39+
- <div class="992:flex-1" />
40+
+ {#if hasOnThisPageContent}
41+
+ <div class="992:flex-1" />
42+
43+
- <OnThisPage
44+
- class={clsx(
45+
- 'pt-8 pb-8 hidden overflow-auto min-w-[160px] sticky right-4 pr-4 1440:right-6 1440:pr-2 1280:block pl-0.5',
46+
- navbar
47+
- ? 'top-[var(--kd--navbar-height)] max-h-[calc(100vh-var(--kd--navbar-height))]'
48+
- : 'top-0 max-h-screen',
49+
- )}
50+
- />
51+
+ <OnThisPage
52+
+ class={clsx(
53+
+ 'pt-8 pb-8 hidden overflow-auto min-w-[160px] sticky right-4 pr-4 1440:right-6 1440:pr-2 1280:block pl-0.5',
54+
+ navbar
55+
+ ? 'top-[var(--kd--navbar-height)] max-h-[calc(100vh-var(--kd--navbar-height))]'
56+
+ : 'top-0 max-h-screen',
57+
+ )}
58+
+ />
59+
+ {/if}
60+
</div>
61+
</div>
62+
diff --git a/client/kit-docs/block/CodeFence.svelte b/client/kit-docs/block/CodeFence.svelte
63+
index a4c662003d01d57e937e0a6a8b996bd195f61afb..5d7bb0b8a7607cc1a7279fc9805a6c966294a40e 100644
64+
--- a/client/kit-docs/block/CodeFence.svelte
65+
+++ b/client/kit-docs/block/CodeFence.svelte
66+
@@ -109,7 +109,7 @@ $: topbarTitle = title ?? (ext === 'sh' ? 'terminal' : ext);
67+
<div class={clsx(showLineNumbers && '992:pl-10')}>
68+
<pre
69+
class={clsx(
70+
- 'relative scrollbar overflow-scroll',
71+
+ 'relative scrollbar !overflow-auto',
72+
showLineNumbers && lines.length >= 100 ? 'pl-6' : 'pl-3',
73+
)}>
74+
{@html code

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

0 commit comments

Comments
 (0)