diff --git a/src/components/SiteFooter.astro b/src/components/SiteFooter.astro index e44f7a4..4b4baf6 100644 --- a/src/components/SiteFooter.astro +++ b/src/components/SiteFooter.astro @@ -1,17 +1,20 @@ --- -// Match the homepage footer without repeating its contacts or primary action. +import ThemeToggle from "./ThemeToggle.astro"; --- @@ -24,7 +27,7 @@ .footer-inner { display: flex; - align-items: baseline; + align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; @@ -34,6 +37,13 @@ color: var(--color-ink-faint); } + .footer-actions { + display: flex; + align-items: center; + gap: 1rem; + max-width: 100%; + } + .footer-inner nav { display: flex; align-items: center; diff --git a/src/components/SiteNav.astro b/src/components/SiteNav.astro index 16e607b..4847f42 100644 --- a/src/components/SiteNav.astro +++ b/src/components/SiteNav.astro @@ -1,21 +1,11 @@ --- -import ThemeToggle from "./ThemeToggle.astro"; - interface Props { action?: { href: string; label: string }; } const { action = { href: "/docs/installation", label: "Install CLI" } } = Astro.props; -// The site nav, shared by the landing header, the blog header and the docs -// header. It used to be duplicated in two places with a comment asking whoever -// touched one to remember the other, which is exactly the smell that says -// extract - the list had already drifted once (GitHub was dropped from the -// landing and left in the docs). -// -// Three clusters - destinations, chrome, action - separated by space rather -// than by a rule, per DOCS-DESIGN.md ยง2. Without the grouping the theme control -// and the brand marks read as nav items. +// Site destinations and the primary action share one navigation row. // // The {" "} between links is load-bearing. Astro trims the newline before a tag // to nothing, so `gap` would otherwise be the only thing separating these words @@ -49,10 +39,6 @@ const path = Astro.url.pathname; } - - - - {action.label} @@ -64,8 +50,7 @@ const path = Astro.url.pathname; font-size: 0.95rem; } - .nav-links, - .nav-chrome { + .nav-links { display: inline-flex; align-items: center; } @@ -74,10 +59,6 @@ const path = Astro.url.pathname; gap: 1.6rem; } - .nav-chrome { - gap: 1.25rem; - } - .header-nav a { color: var(--color-ink-soft); text-decoration: none; @@ -112,7 +93,7 @@ const path = Astro.url.pathname; } @media (max-width: 40rem) { - .header-cta { + .header-nav { display: none; } } diff --git a/src/components/ThemeToggle.astro b/src/components/ThemeToggle.astro index c26a67f..f7943b5 100644 --- a/src/components/ThemeToggle.astro +++ b/src/components/ThemeToggle.astro @@ -67,6 +67,10 @@ .theme-toggle { display: inline-flex; align-items: center; + justify-content: center; + flex-shrink: 0; + width: 2rem; + height: 2rem; border: 0; background: transparent; padding: 0; @@ -79,6 +83,11 @@ color: var(--color-ink); } + .theme-toggle:focus-visible { + outline: 2px solid var(--color-ink); + outline-offset: 2px; + } + .theme-toggle svg { display: none; } diff --git a/src/layouts/BlogLayout.astro b/src/layouts/BlogLayout.astro index 983ddc9..557a3f1 100644 --- a/src/layouts/BlogLayout.astro +++ b/src/layouts/BlogLayout.astro @@ -2,7 +2,6 @@ import Base from "./Base.astro"; import SiteHeader from "../components/SiteHeader.astro"; import SiteFooter from "../components/SiteFooter.astro"; -import ThemeToggle from "../components/ThemeToggle.astro"; interface Props { title: string; @@ -14,9 +13,6 @@ interface Props { Skip to content -
- -
@@ -40,23 +36,6 @@ interface Props { padding: 2.5rem var(--site-gutter) 3rem; } - .page-tools { - position: absolute; - top: 0.5rem; - right: 0.5rem; - } - - .page-tools :global(.theme-toggle) { - width: 2.5rem; - height: 2.5rem; - justify-content: center; - } - - .page-tools :global(.theme-toggle:focus-visible) { - outline: 2px solid var(--color-ink); - outline-offset: 2px; - } - .blog-shell:focus { outline: none; } diff --git a/src/layouts/DocsLayout.astro b/src/layouts/DocsLayout.astro index 60173f9..7c9bea9 100644 --- a/src/layouts/DocsLayout.astro +++ b/src/layouts/DocsLayout.astro @@ -8,6 +8,7 @@ import DocsPager from "../components/docs/DocsPager.astro"; import DocsSidebar from "../components/docs/DocsSidebar.astro"; import DocsTableOfContents from "../components/docs/DocsTableOfContents.astro"; import Base from "./Base.astro"; +import SiteFooter from "../components/SiteFooter.astro"; import { getBreadcrumbs, getNavigation, @@ -74,4 +75,5 @@ const hasToc = tableOfContents.length > 0; ) } + diff --git a/src/pages/index.astro b/src/pages/index.astro index 176be7d..3e059e0 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -3,7 +3,7 @@ import Base from "../layouts/Base.astro"; import Brand from "../components/Brand.astro"; import ContactLinks from "../components/ContactLinks.astro"; import FeaturedPost from "../components/FeaturedPost.astro"; -import ThemeToggle from "../components/ThemeToggle.astro"; +import SiteFooter from "../components/SiteFooter.astro"; --- -
- -
-
@@ -230,17 +226,7 @@ summary.size.outcome = "dist/app.wasm"
- +