fix: fix admin mobile nav overflow breaking layout on small screens
Mobile nav now scrolls horizontally with hidden scrollbar; nav items don't shrink and show icon-only on xs, icon+label on sm and up. Added scrollbar-none utility to app.css. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,13 @@
|
|||||||
|
|
||||||
@plugin "@iconify/tailwind4";
|
@plugin "@iconify/tailwind4";
|
||||||
|
|
||||||
|
@utility scrollbar-none {
|
||||||
|
scrollbar-width: none;
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@custom-variant dark (&:where(.dark, .dark *));
|
@custom-variant dark (&:where(.dark, .dark *));
|
||||||
|
|
||||||
@custom-variant hover (&:hover);
|
@custom-variant hover (&:hover);
|
||||||
|
|||||||
@@ -24,26 +24,28 @@
|
|||||||
<div class="min-h-screen bg-gradient-to-br from-background via-primary/5 to-accent/5">
|
<div class="min-h-screen bg-gradient-to-br from-background via-primary/5 to-accent/5">
|
||||||
<div class="container mx-auto px-4">
|
<div class="container mx-auto px-4">
|
||||||
<!-- Mobile top nav -->
|
<!-- Mobile top nav -->
|
||||||
<div class="lg:hidden flex items-center gap-2 py-3 border-b border-border/40">
|
<div class="lg:hidden border-b border-border/40">
|
||||||
<a
|
<div class="flex items-center gap-1 overflow-x-auto py-2 scrollbar-none">
|
||||||
href="/"
|
|
||||||
class="text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 mr-2"
|
|
||||||
>
|
|
||||||
{$_("admin.nav.back_mobile")}
|
|
||||||
</a>
|
|
||||||
{#each navLinks as link (link.href)}
|
|
||||||
<a
|
<a
|
||||||
href={link.href}
|
href="/"
|
||||||
class={`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${
|
class="shrink-0 text-xs text-muted-foreground hover:text-foreground transition-colors px-2"
|
||||||
isActive(link.href)
|
|
||||||
? "bg-primary/10 text-primary"
|
|
||||||
: "text-muted-foreground hover:text-foreground hover:bg-muted/50"
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<span class={`${link.icon} h-4 w-4`}></span>
|
{$_("admin.nav.back_mobile")}
|
||||||
{link.name}
|
|
||||||
</a>
|
</a>
|
||||||
{/each}
|
{#each navLinks as link (link.href)}
|
||||||
|
<a
|
||||||
|
href={link.href}
|
||||||
|
class={`shrink-0 flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium transition-colors ${
|
||||||
|
isActive(link.href)
|
||||||
|
? "bg-primary/10 text-primary"
|
||||||
|
: "text-muted-foreground hover:text-foreground hover:bg-muted/50"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span class={`${link.icon} h-4 w-4 shrink-0`}></span>
|
||||||
|
<span class="hidden sm:inline">{link.name}</span>
|
||||||
|
</a>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Desktop layout -->
|
<!-- Desktop layout -->
|
||||||
|
|||||||
Reference in New Issue
Block a user