aboutsummaryrefslogtreecommitdiff
path: root/src/lib/components/Nav.svelte
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-10-06 00:05:49 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-10-06 00:05:49 +0200
commitf6563f22a9a0c9d876f80e8f758b902dcc3bec78 (patch)
tree5b7fc20b153a7ba6c172de8bbb32a743ed5e70f7 /src/lib/components/Nav.svelte
parent3dccdc1d11845edabe238e5cfd9a175c3dae208e (diff)
Restyle to a flat Miniflux-like design
- hairline separators instead of bordered rows, square corners, no shadows - white background, system font stack, slimmer headings - pine green accent; amber warn ramp carries the attention marks (due/late/mid) - no hover backgrounds: hover is color/fill-state only - reserve bold nav tab width and the scrollbar gutter so navigation never shifts layout
Diffstat (limited to 'src/lib/components/Nav.svelte')
-rw-r--r--src/lib/components/Nav.svelte52
1 files changed, 37 insertions, 15 deletions
diff --git a/src/lib/components/Nav.svelte b/src/lib/components/Nav.svelte
index aa42ace..c5fcc60 100644
--- a/src/lib/components/Nav.svelte
+++ b/src/lib/components/Nav.svelte
@@ -1,19 +1,27 @@
-<script lang="ts">
+<script>
import { page } from '$app/stores';
</script>
<nav class="navbar">
- <a href="/" class:active={$page.url.pathname === '/'}>Projets</a>
- <a href="/groceries" class:active={$page.url.pathname === '/groceries'}
- >Liste</a
+ <a href="/" data-label="Projets" class:active={$page.url.pathname === '/'}
+ ><span>Projets</span></a
+ >
+ <a
+ href="/groceries"
+ data-label="Liste"
+ class:active={$page.url.pathname === '/groceries'}><span>Liste</span></a
>
<a
href="/groceries/catalog"
- class:active={$page.url.pathname === '/groceries/catalog'}>Catalogue</a
+ data-label="Catalogue"
+ class:active={$page.url.pathname === '/groceries/catalog'}
+ ><span>Catalogue</span></a
>
<a
href="/groceries/categories"
- class:active={$page.url.pathname === '/groceries/categories'}>Catégories</a
+ data-label="Catégories"
+ class:active={$page.url.pathname === '/groceries/categories'}
+ ><span>Catégories</span></a
>
</nav>
@@ -32,23 +40,37 @@
}
.navbar a {
- padding: 0.5rem 1rem;
- border-radius: 9999px;
+ height: 100%;
+ display: inline-grid;
+ align-content: center;
+ padding: 0 0.625rem;
+ font-size: 0.875rem;
color: var(--text-secondary);
text-decoration: none;
- font-size: 0.875rem;
- font-weight: 500;
- transition: all 0.2s ease;
+ }
+
+ /* Bold ghost reserves the bold advance width in the same grid cell, so the
+ active tab's font-weight change never moves its siblings. */
+ .navbar a::before {
+ content: attr(data-label);
+ grid-area: 1 / 1;
+ visibility: hidden;
+ font-weight: 700;
+ }
+
+ .navbar a span {
+ grid-area: 1 / 1;
}
.navbar a:hover {
color: var(--text);
- background: var(--surface);
}
.navbar a.active {
- background: var(--accent);
- color: var(--white);
- box-shadow: 0 1px 2px var(--shadow);
+ color: var(--text);
+ }
+
+ .navbar a.active span {
+ font-weight: 700;
}
</style>