Skip to Content
GlobalNavbar

Navbar

Global navigation component styling.

Overview

The navbar contains a logo, search bar, and navigation links. Layout includes authenticated and unauthenticated states.

Elements

Main Container

nav { padding: 12px 0; }
/* Logo container */ nav .flex:first-child { display: flex; align-items: center; justify-content: space-between; } /* Logo */ nav img { width: 28px; height: auto; transition: transform 0.2s ease; } nav img:hover { transform: scale(1.1); } /* Search form */ nav form { display: flex; } /* Search input */ nav form input { max-width: 224px; width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid #333; padding: 8px 12px; border-radius: 4px; color: #fff; font-size: 0.875rem; } nav form input:focus { outline: none; border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2); } nav form input::placeholder { color: #666; }
/* Links container */ nav .flex.items-center.justify-center { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; } /* All navigation links */ nav .flex.items-center.justify-center a { font-size: 0.75rem; color: #ccc; text-decoration: none; transition: all 0.2s ease; } nav .flex.items-center.justify-center a:hover { color: #22c55e; /* primary */ text-decoration: underline; } /* Logout button */ nav button { font-size: 0.75rem; background: none; border: none; cursor: pointer; color: #ef4444; /* destructive */ transition: all 0.2s ease; } nav button:hover { text-decoration: underline; }

Notification Badge

/* Notification count */ nav .text-primary { color: #22c55e; font-weight: 600; }

Advanced Styling

Responsive Design

/* Mobile adjustments */ @media (max-width: 768px) { nav .flex:first-child { flex-direction: column; gap: 12px; } nav form { width: 100%; } nav form input { max-width: none; } nav .flex.items-center.justify-center { gap: 8px; } }
/* Bracket animation for links */ nav a { position: relative; overflow: hidden; } nav a::before { content: ''; position: absolute; left: -100%; top: 0; width: 100%; height: 2px; background: #22c55e; transition: left 0.3s ease; } nav a:hover::before { left: 0; }

Search Enhancements

/* Search container with icon */ nav form { position: relative; } nav form::after { content: '🔍'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: 0.6; } /* Focus state improvements */ nav form input:focus + ::after { opacity: 1; }

Logo Enhancements

/* Logo with subtle glow */ nav img { filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.3)); } nav img:hover { filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.5)); }

State-Based Styling

Authenticated State

/* When user is logged in, style profile-specific links */ nav a[href*="/settings"] { color: #fbbf24; /* amber for settings */ } nav a[href*="/notifications"] { color: #3b82f6; /* blue for notifications */ }

Notification Count

/* Style notification badge */ nav a[href="/notifications"] span { background: #22c55e; color: #000; padding: 2px 6px; border-radius: 10px; font-size: 0.625rem; margin-left: 4px; }
Last updated on