Skip to content

Commit 4d7444e

Browse files
Visual regression fixes and improvements (#3407)
1 parent 54760de commit 4d7444e

34 files changed

Lines changed: 488 additions & 464 deletions

_components/Base.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export default function Base(
1111
parts={data.breadcrumbs_ctx.parts}
1212
hasSubNav={false}
1313
/>
14-
<main id="content" tabindex={-1}>
15-
{children}
16-
</main>
14+
{children}
1715
</div>
1816
</>
1917
);

_components/CopyPage.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export default function CopyPage({ file }: { file: string | undefined }) {
99
}`;
1010

1111
return (
12-
<div class="copy-page-split inline-flex shrink-0 rounded-full border-2 border-foreground-primary dark:border-background-tertiary">
12+
<div className="copy-page-split inline-flex shrink-0 rounded-full border border-foreground-primary dark:border-background-tertiary">
1313
{/* Primary: directly copies the URL */}
1414
<button
1515
type="button"
16-
class="copy-page-main-btn flex items-center gap-2 px-4 py-2 text-sm font-semibold text-foreground-primary bg-transparent hover:bg-header-highlight dark:hover:text-background-primary rounded-l-full transition-colors cursor-pointer select-none"
16+
className="copy-page-main-btn flex items-center gap-2 pl-3 pr-2 py-1 text-xs font-semibold text-foreground-primary bg-transparent hover:bg-header-highlight dark:hover:text-background-primary rounded-l-full transition-colors cursor-pointer select-none"
1717
>
1818
<svg
1919
xmlns="http://www.w3.org/2000/svg"
@@ -26,26 +26,26 @@ export default function CopyPage({ file }: { file: string | undefined }) {
2626
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z" />
2727
<path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z" />
2828
</svg>
29-
<span class="copy-page-main-label">Copy page</span>
29+
<span className="copy-page-main-label">Copy page</span>
3030
</button>
3131

3232
{/* Visual divider between the two halves */}
3333
<span
34-
class="self-stretch w-0.5 bg-foreground-primary dark:bg-background-tertiary shrink-0"
34+
className="self-stretch w-px bg-foreground-primary dark:bg-background-tertiary shrink-0"
3535
aria-hidden="true"
3636
>
3737
</span>
3838

3939
{/* Chevron: opens the popover panel */}
4040
<button
4141
type="button"
42-
class="copy-page-toggle-btn flex items-center px-3 py-2 text-foreground-primary bg-transparent hover:bg-header-highlight dark:hover:text-background-primary rounded-r-full transition-colors cursor-pointer select-none"
42+
className="copy-page-toggle-btn flex items-center pl-1.5 pr-2 text-foreground-primary bg-transparent hover:bg-header-highlight dark:hover:text-background-primary rounded-r-full transition-colors cursor-pointer select-none"
4343
popovertarget="copy-page-menu"
4444
aria-label="More copy options"
4545
aria-haspopup="menu"
4646
>
4747
<svg
48-
class="copy-page-chevron transition-transform duration-200"
48+
className="copy-page-chevron transition-transform duration-200"
4949
xmlns="http://www.w3.org/2000/svg"
5050
aria-hidden="true"
5151
fill="currentColor"
@@ -58,11 +58,11 @@ export default function CopyPage({ file }: { file: string | undefined }) {
5858
</button>
5959

6060
{/* Popover panel — positioned via CSS anchor positioning, JS fallback */}
61-
<div id="copy-page-menu" popover="auto" class="copy-page-panel">
61+
<div id="copy-page-menu" popover="auto" className="copy-page-panel">
6262
<a
6363
href={file}
6464
target="_blank"
65-
class="no-underline flex items-start gap-3 px-4 py-3 hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
65+
className="no-underline flex items-start gap-3 px-4 py-3 hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
6666
>
6767
<svg
6868
xmlns="http://www.w3.org/2000/svg"
@@ -71,21 +71,23 @@ export default function CopyPage({ file }: { file: string | undefined }) {
7171
width="16"
7272
height="16"
7373
viewBox="0 0 16 16"
74-
class="mt-0.5 shrink-0"
74+
className="mt-0.5 shrink-0"
7575
>
7676
<path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z" />
7777
</svg>
7878
<span>
79-
<span class="block text-sm font-medium">View Page as Markdown</span>
80-
<span class="block text-xs text-foreground-secondary mt-0.5">
79+
<span className="block text-sm font-medium">
80+
View Page as Markdown
81+
</span>
82+
<span className="block text-xs text-foreground-secondary mt-0.5">
8183
Open the Markdown file in a new tab
8284
</span>
8385
</span>
8486
</a>
8587
<a
8688
href={claudeUrl}
8789
target="_blank"
88-
class="no-underline flex items-start gap-3 px-4 py-3 border-t border-foreground-tertiary hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
90+
className="no-underline flex items-start gap-3 px-4 py-3 border-t border-foreground-tertiary hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
8991
>
9092
<svg
9193
xmlns="http://www.w3.org/2000/svg"
@@ -94,21 +96,21 @@ export default function CopyPage({ file }: { file: string | undefined }) {
9496
width="16"
9597
height="16"
9698
viewBox="0 0 24 24"
97-
class="mt-0.5 shrink-0"
99+
className="mt-0.5 shrink-0"
98100
>
99101
<path d="M12 0C12 0 10.5 10.5 0 12C10.5 12 12 24 12 24C12 24 13.5 13.5 24 12C13.5 12 12 0 12 0Z" />
100102
</svg>
101103
<span>
102-
<span class="block text-sm font-medium">Open in Claude</span>
103-
<span class="block text-xs text-foreground-secondary mt-0.5">
104+
<span className="block text-sm font-medium">Open in Claude</span>
105+
<span className="block text-xs text-foreground-secondary mt-0.5">
104106
Ask Claude about this page
105107
</span>
106108
</span>
107109
</a>
108110
<a
109111
href="/llms.txt"
110112
target="_blank"
111-
class="no-underline flex items-start gap-3 px-4 py-3 border-t border-foreground-tertiary hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
113+
className="no-underline flex items-start gap-3 px-4 py-3 border-t border-foreground-tertiary hover:bg-background-secondary dark:hover:bg-gray-800 transition-colors"
112114
>
113115
<svg
114116
xmlns="http://www.w3.org/2000/svg"
@@ -117,13 +119,13 @@ export default function CopyPage({ file }: { file: string | undefined }) {
117119
width="16"
118120
height="16"
119121
viewBox="0 0 16 16"
120-
class="mt-0.5 shrink-0"
122+
className="mt-0.5 shrink-0"
121123
>
122124
<path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z" />
123125
</svg>
124126
<span>
125-
<span class="block text-sm font-medium">llms.txt</span>
126-
<span class="block text-xs text-foreground-secondary mt-0.5">
127+
<span className="block text-sm font-medium">llms.txt</span>
128+
<span className="block text-xs text-foreground-secondary mt-0.5">
127129
Machine-readable index of these docs for AI tools
128130
</span>
129131
</span>

_components/Feedback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Feedback({ file }: { file: string | undefined }) {
77
return (
88
<section
99
id="feedback-section"
10-
class="mt-10 pt-6 border-t border-t-foreground-tertiary"
10+
class="mt-16 pt-6 border-t border-t-foreground-tertiary"
1111
>
1212
<form aria-live="polite" id="feedback-form">
1313
<div

_components/Footer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export default function Footer_new() {
22
return (
3-
<footer className="text-smaller bg-gray-50 dark:bg-gray-950 p-4 pt-12 sm:px-8 border-t border-t-foreground-tertiary">
4-
<nav className="flex flex-col gap-x-4 gap-y-12 max-w-[var(--layout-max-width)] md:flex-row md:flex-wrap md:justify-between md:w-full md:gap-y-8 md:mx-auto">
3+
<footer className="text-smaller bg-gray-50 dark:bg-gray-950 p-4 pt-12 border-t border-t-foreground-tertiary">
4+
<nav className="flex flex-col gap-x-4 gap-y-12 w-max max-w-full md:flex-row md:flex-wrap md:justify-between md:gap-16 lg:gap-24">
55
{data.map((category) => (
66
<section className="flex-auto">
77
<h3 className="mb-2 uppercase font-bold text-foreground-primary whitespace-pre">
88
{category.title}
99
</h3>
10-
<ul className="m-0 p-0 pl-3 border-l border-l-background-tertiary list-none">
10+
<ul className="m-0 p-0 pl-3 border-l border-l-sidebar-line list-none">
1111
{category.items.map((item) => (
1212
<li>
1313
<a
@@ -21,7 +21,7 @@ export default function Footer_new() {
2121
</section>
2222
))}
2323
</nav>
24-
<p className="m-0 mt-16 mx-auto text-center text-xs text-foreground-secondary">
24+
<p className="m-0 mt-16 mx-auto text-xs text-foreground-secondary">
2525
Copyright © {new Date().getFullYear()} the Deno authors.
2626
</p>
2727
</footer>

_components/Header.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,24 @@ export default function (
1818

1919
return (
2020
<header
21-
class={`w-full h-auto sticky top-0 z-[100] bg-background-raw ${
22-
hasSubNav ? "" : "border-b border-b-foreground-tertiary"
23-
}`}
21+
className={`w-full h-auto sticky top-0 z-100 bg-background-raw border-b border-b-foreground-tertiary`}
2422
>
25-
<div class="grid grid-cols-[auto_1fr] md:grid-cols-[auto_auto_1fr] h-[var(--header-height)] gap-x-4 items-center justify-between px-4 w-full max-w-[var(--layout-max-width)] mx-auto xlplus:px-0">
23+
<div className="grid grid-cols-[auto_1fr] md:grid-cols-[auto_auto_1fr] h-(--header-height) gap-x-4 items-center justify-between px-4 w-full mx-auto">
2624
<a
2725
href="https://deno.com"
2826
title="Deno main website"
29-
className="block h-8 w-8 xs:w-auto md:h-10 md:mr-auto overflow-hidden"
27+
className="block h-8 w-8 xs:w-auto md:h-10 md:mr-auto md:w-10 lg:w-auto overflow-hidden"
3028
>
3129
<data.comp.DenoLogo />
3230
</a>
3331
<nav
3432
id="main-nav"
35-
class="flex h-full items-center row-start-2 col-span-2 md:row-auto md:col-auto -mx-4 md:mx-0 overflow-x-auto md:overflow-clip"
33+
className="flex h-full items-center row-start-2 col-span-2 md:row-auto md:col-auto -mx-4 md:mx-0 overflow-x-auto md:overflow-clip"
3634
>
3735
{data.navigation.map((nav: NavData) => (
3836
<a
3937
href={nav.href}
40-
className={`font-[clamp(0.8rem,1.5vw,1rem)] whitespace-nowrap relative py-0 px-4 h-full flex justify-center items-center text-foreground-primary hover:text-gray-800 transition-colors duration-200 ${
38+
className={`text-sm md:text-base whitespace-nowrap relative py-0 px-4 md:px-3 lg:px-4 h-full flex justify-center items-center text-foreground-primary hover:text-gray-800 transition-colors duration-200 ${
4139
hrefIsInCurrentSection(nav.href, currentSection)
4240
? "font-bold text-gray-800 bg-header-highlight"
4341
: ""
@@ -49,7 +47,7 @@ export default function (
4947
{hrefIsInCurrentSection(nav.href, currentSection) && (
5048
<div
5149
id="current-nav-item"
52-
class="absolute inset-0 bg-header-highlight -z-10 transition-transform duration-200 easing-[cubic-bezier(0.5,0,0.5,1)] origin-left"
50+
className="absolute inset-0 bg-header-highlight -z-10 transition-transform duration-200 easing-[cubic-bezier(0.5,0,0.5,1)] origin-left"
5351
style="--left: 0px; --scaleX: 1; transform: translateX(var(--left)) scaleX(var(--scaleX));"
5452
/>
5553
)}

_components/LandingPage.tsx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function LandingPage(
4545

4646
return (
4747
<>
48-
<main id="content">
48+
<div>
4949
<div className="flex flex-col md:flex-row w-full mb-8 max-w-screen-xl justify-between">
5050
<div className="max-w-prose mb-8">
5151
<h1 className="text-2xl font-semibold sm:text-3xl md:text-4xl mb-3">
@@ -105,7 +105,7 @@ export default function LandingPage(
105105
<a
106106
key={item.href}
107107
href={item.href}
108-
className="group relative flex flex-col gap-1 p-4 pr-12 rounded-lg border border-foreground-tertiary bg-background-secondary !no-underline hover:border-primary transition-colors duration-150"
108+
className="group relative flex flex-col gap-2 p-4 pr-12 rounded-lg border border-background-tertiary bg-background-raw dark:bg-background-primary no-underline! hover:border-primary transition-colors duration-150"
109109
>
110110
<span
111111
className="absolute top-4 right-4"
@@ -114,18 +114,18 @@ export default function LandingPage(
114114
>
115115
<TypeIcon type={item.type} />
116116
</span>
117-
<span className="font-semibold !text-foreground-primary group-hover:underline underline-offset-4 decoration-primary">
117+
<span className="leading-none font-semibold !text-foreground-primary group-hover:underline underline-offset-4 decoration-primary">
118118
<FeaturedStar /> {item.title}
119119
</span>
120-
<span className="text-sm text-foreground-secondary">
120+
<span className="text-xs text-foreground-secondary">
121121
{item.description}
122122
</span>
123123
</a>
124124
))}
125125
</div>
126126
</section>
127127

128-
<section className="flex flex-col gap-4 w-full mb-8 p-4 border border-blue-100 dark:border-background-tertiary bg-blue-50 dark:bg-background-secondary rounded md:flex-wrap md:justify-start md:items-center md:flex-row">
128+
<section className="flex flex-col gap-4 w-full mb-4 mt-16 p-4 border border-blue-100 dark:border-background-tertiary bg-blue-50 dark:bg-background-secondary rounded md:flex-wrap md:justify-start md:items-center md:flex-row">
129129
<h2 className="font-semibold">
130130
Filter by type:
131131
</h2>
@@ -159,35 +159,36 @@ export default function LandingPage(
159159
</span>
160160
</label>
161161

162-
<label for="video" className="flex gap-2 items-center mr-4">
163-
<VideoIcon size="1.5rem" />
164-
<span>Videos ({counts.video})</span>
165-
<span className="switch">
166-
<input
167-
type="checkbox"
168-
id="video"
169-
value="Videos"
170-
className="filter mr-2"
171-
checked
172-
/>
173-
<span className="slider"></span>
174-
</span>
175-
</label>
176-
162+
{counts.video > 0 && (
163+
<label for="video" className="flex gap-2 items-center mr-4">
164+
<VideoIcon size="1.5rem" />
165+
<span>Videos ({counts.video})</span>
166+
<span className="switch">
167+
<input
168+
type="checkbox"
169+
id="video"
170+
value="Videos"
171+
className="filter mr-2"
172+
checked
173+
/>
174+
<span className="slider"></span>
175+
</span>
176+
</label>
177+
)}
177178
<span className="md:ml-auto text-sm text-foreground-secondary">
178179
{total} items total
179180
</span>
180181
</section>
181182

182183
<nav
183-
className="flex flex-wrap gap-2 mb-10"
184+
className="flex flex-wrap gap-1 mb-10"
184185
aria-label="Example categories"
185186
>
186187
{sidebar.map((category: { title: string }) => (
187188
<a
188189
key={category.title}
189190
href={`#${category.title.toLowerCase().replace(/\s+/g, "-")}`}
190-
className="px-3 py-1 rounded-full border border-foreground-tertiary text-sm !no-underline text-foreground-secondary hover:border-primary hover:text-primary transition-colors duration-150"
191+
className="px-2 py-1 rounded-full border border-foreground-tertiary text-xs !no-underline text-foreground-secondary hover:border-primary hover:text-primary transition-colors duration-150"
191192
>
192193
{category.title}
193194
</a>
@@ -209,7 +210,7 @@ export default function LandingPage(
209210
alt="sad Deno with a grad cap"
210211
/>
211212
</div>
212-
</main>
213+
</div>
213214
</>
214215
);
215216
}

_components/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function (
1515
return (
1616
<>
1717
<aside
18-
className={`fixed transition-all duration-200 md:duration-0 easing-[cubic-bezier(0.165,0.84,0.44,1)] -translate-x-full z-50 w-full bg-background-raw opacity-0 p-4 pb-8 overflow-auto text-smaller md:sticky md:overflow-y-auto md:[scrollbar-width:thin] md:z-10 md:!translate-x-0 md:!opacity-100 md:p-0 md:pb-16 lg:border-r lg:border-r-foreground-tertiary lg:w-full sidebar-open:translate-x-0 sidebar-open:opacity-100
18+
className={`fixed transition-all duration-200 md:duration-0 easing-[cubic-bezier(0.165,0.84,0.44,1)] -translate-x-full z-50 w-full bg-background-raw opacity-0 p-4 pb-8 overflow-auto text-smaller md:sticky md:overflow-y-auto md:[scrollbar-width:thin] md:z-10 md:!translate-x-0 md:!opacity-100 md:p-0 md:pt-4 md:pb-16 lg:border-r lg:border-r-foreground-tertiary lg:w-full sidebar-open:translate-x-0 sidebar-open:opacity-100
1919
${
2020
hasSubNav
2121
? "top-header-plus-subnav h-screen-minus-both"

_components/SearchInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function SearchInput() {
88
placeholder="Search"
99
id="orama-search-input"
1010
className="w-full min-w-24 rounded-lg placeholder:text-sm text-base leading-normal p-1 pl-8 border transition-all duration-150
11-
text-foreground-primary border-foreground-secondary hover:bg-background-secondary focus:bg-background-secondary focus:outline-offset-1"
11+
text-foreground-primary border-foreground-tertiary hover:bg-background-secondary focus:bg-background-secondary focus:outline-offset-1"
1212
style="background: url(/img/search.svg) no-repeat 0.5em 50%; background-size: 1.25em; background-color: var(--color-background-raw);"
1313
/>
1414
<kbd

0 commit comments

Comments
 (0)