Files
kochwas/src/routes/admin/+layout.svelte
hsiegeln 5a291a53dd
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 1m22s
refactor(ui): --pill-radius CSS-Variable (Item F)
border-radius: 999px war 15x im CSS dupliziert. Ausgelagert als
:root --pill-radius Variable im globalen :root-Block in +layout.svelte,
Call-Sites auf var(--pill-radius) umgestellt.

Bewusst NICHT angefasst (plan war "nur Werte die mehrfach vorkommen"):
- z-index: 10 Distinct Values in 14 Sites, bilden ein implizites
  Layer-System. Konsolidieren = behavior-change-Risiko ohne konkreten
  Nutzen. Wenn kuenftig einheitliche Modal-/Popover-Layer noetig,
  separate Phase.
- setTimeout(): 3 Sites, jeder mit eigener Semantik (Debounce/Print/
  Spinner). Kein DRY-Nutzen durch Extraktion.

Gate: svelte-check 0 Warnings, 184/184 Tests, Build clean, kein
sichtbarer Unterschied (einzige Aenderung: selber Wert ueber Variable).

Refs docs/superpowers/plans/2026-04-19-post-review-roadmap.md Item F.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 11:43:19 +02:00

64 lines
1.5 KiB
Svelte

<script lang="ts">
import { page } from '$app/stores';
import { Globe, Users, DatabaseBackup, Smartphone, type Icon } from 'lucide-svelte';
let { children } = $props();
const items: { href: string; label: string; icon: typeof Icon }[] = [
{ href: '/admin/domains', label: 'Domains', icon: Globe },
{ href: '/admin/profiles', label: 'Profile', icon: Users },
{ href: '/admin/backup', label: 'Backup', icon: DatabaseBackup },
{ href: '/admin/app', label: 'App', icon: Smartphone }
];
</script>
<nav class="tabs">
{#each items as item (item.href)}
{@const Icon = item.icon}
<a
href={item.href}
class="tab"
class:active={$page.url.pathname.startsWith(item.href)}
>
<Icon size={16} strokeWidth={2} />
<span>{item.label}</span>
</a>
{/each}
</nav>
<section class="admin-body">
{@render children()}
</section>
<style>
.tabs {
display: flex;
gap: 0.25rem;
padding: 0.75rem 0 0;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.tab {
padding: 0.5rem 0.95rem 0.5rem 0.8rem;
background: white;
border: 1px solid #e4eae7;
border-radius: var(--pill-radius);
text-decoration: none;
color: #444;
font-size: 0.95rem;
white-space: nowrap;
min-height: 40px;
display: inline-flex;
align-items: center;
gap: 0.4rem;
}
.tab.active {
background: #2b6a3d;
color: white;
border-color: #2b6a3d;
}
.admin-body {
padding: 1rem 0;
}
</style>