feat: dark mode for login page

This commit is contained in:
Araozu 2024-11-01 06:52:58 -05:00
parent 9f14cabc4c
commit d3c498a746
4 changed files with 46 additions and 22 deletions

View File

@ -7,7 +7,7 @@ templ LoginTempl() {
<nav class="bg-sky-500 text-white text-xl font-bold p-2"> <nav class="bg-sky-500 text-white text-xl font-bold p-2">
music to go music to go
</nav> </nav>
<div hx-ext="response-targets"> <div hx-ext="response-targets" class="container">
Login to Navidrome: Login to Navidrome:
<br/> <br/>
<form <form
@ -22,7 +22,7 @@ templ LoginTempl() {
</label> </label>
<input <input
id="navidrome-url" id="navidrome-url"
class="w-full py-1 px-2 rounded" class="w-full py-1 px-2 rounded bg-c-bg text-c-on-bg border border-sky-400"
placeholder="https://" placeholder="https://"
name="navidrome-url" name="navidrome-url"
required required
@ -33,7 +33,7 @@ templ LoginTempl() {
</label> </label>
<input <input
id="username" id="username"
class="w-full py-1 px-2 rounded" class="w-full py-1 px-2 rounded bg-c-bg text-c-on-bg border border-sky-400"
placeholder="username" placeholder="username"
name="username" name="username"
required required
@ -44,7 +44,7 @@ templ LoginTempl() {
</label> </label>
<input <input
id="password" id="password"
class="w-full py-1 px-2 rounded" class="w-full py-1 px-2 rounded bg-c-bg text-c-on-bg border border-sky-400"
placeholder="password" placeholder="password"
name="password" name="password"
type="password" type="password"

View File

@ -28,9 +28,9 @@ templ IndexTempl(albums []utils.Album) {
} }
templ AlbumCard(album utils.Album) { templ AlbumCard(album utils.Album) {
<div class="inline-block p-1 rounded bg-zinc-200 dark:bg-zinc-800 w-full max-w-32"> <div class="inline-block p-1 rounded bg-zinc-200 dark:bg-zinc-800">
<div class="h-30 w-28 relative"> <div class="h-30 w-28 relative">
<img src={ fmt.Sprintf("/covers/%s", album.ID) }/> <img class="w-full" src={ fmt.Sprintf("/covers/%s", album.ID) }/>
<a <a
href={ templ.URL(fmt.Sprintf("/album/%s", album.ID)) } href={ templ.URL(fmt.Sprintf("/album/%s", album.ID)) }
class="inline-block w-full overflow-hidden whitespace-nowrap overflow-ellipsis hover:underline" class="inline-block w-full overflow-hidden whitespace-nowrap overflow-ellipsis hover:underline"

View File

@ -1,16 +0,0 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./src/**/*.{html,templ,go}",
],
theme: {
extend: {
colors: {
"c-bg": "var(--c-bg)",
"c-on-bg": "var(--c-on-bg)",
}
},
},
plugins: [],
}

40
tailwind.config.mjs Normal file
View File

@ -0,0 +1,40 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./src/**/*.{html,templ,go}",
],
theme: {
extend: {
colors: {
"c-bg": "var(--c-bg)",
"c-on-bg": "var(--c-on-bg)",
}
},
},
corePlugins: {
container: false
},
plugins: [
function({ addComponents }) {
addComponents({
'.container': {
maxWidth: '95%',
margin: "auto",
'@screen sm': {
maxWidth: '640px',
},
'@screen md': {
maxWidth: '768px',
},
'@screen lg': {
maxWidth: '1024px',
},
'@screen xl': {
maxWidth: '1280px',
},
}
})
}
],
}