Skip to content

Commit

Permalink
impl: nicer navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevMinerTV committed Oct 4, 2023
1 parent d3e6f06 commit 45d6fa7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions internal/web/layouts/logged-in.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<link rel="stylesheet" href="/static/styles.css" />
</head>

<body class="flex h-full flex-col">
<body class="flex h-full flex-col overflow-y-scroll">
<nav class="flex h-12 min-h-[3rem] w-full border-b border-b-gray-600">
<div class="m-auto flex w-full max-w-4xl items-center gap-4 px-4 py-1">
<div class="flex flex-1 justify-start gap-4 text-gray-500">
<div class="flex flex-1 justify-start gap-2 text-gray-500">
<a href="/" class="{{ navbarActive .activePage "/" }} transition-colors hocus:text-white"> LDAP Manager </a>
<a class="{{ navbarActive .activePage "/users" }} transition-colors hocus:text-white" href="/users">Users</a>
<a class="{{ navbarActive .activePage "/groups" }} transition-colors hocus:text-white" href="/groups">
Expand All @@ -46,7 +46,7 @@
</div>
</nav>

<div class="mx-auto w-full max-w-4xl flex-1 overflow-y-visible p-4">
<div class="mx-auto w-full max-w-4xl flex-1 p-4">
{{ embed }}
</div>
</body>
Expand Down
6 changes: 3 additions & 3 deletions internal/web/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ func tplInputOpts(name, placeholder, type_, autocomplete string) InputOpts {
}
}

const NavbarItemBaseClass = "px-2 py-1 "
const NavbarItemBaseClass = "px-3 py-1 rounded-md "

func tplNavbarActive(activeTab, tab string) string {
if activeTab == tab {
return NavbarItemBaseClass + "text-white font-bold bg-gray-700 rounded-md"
return NavbarItemBaseClass + "text-white bg-gray-700"
}

return NavbarItemBaseClass
return NavbarItemBaseClass + "text-gray-500 hocus:bg-gray-800"
}
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config = {
theme: {
extend: {}
},
safelist: ["bg-gray-700"]
safelist: ["bg-gray-700", "hocus:bg-gray-800"]
};

export default config;

0 comments on commit 45d6fa7

Please sign in to comment.