mirror of
https://github.com/1f349/tulip.git
synced 2025-01-26 17:26:48 +00:00
Better dark mode support
This commit is contained in:
parent
56ff556928
commit
ab4693a9ac
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load", function () {
|
window.addEventListener("load", function () {
|
||||||
selectText("app-secret");
|
selectText("app-secret");
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{.ServiceName}}</title>
|
<title>{{.ServiceName}}</title>
|
||||||
<link rel="stylesheet" href="/theme/dark.css" media="screen and (prefers-color-scheme: dark)">
|
<link rel="stylesheet" href="/theme/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -156,8 +156,8 @@ func NewHttpServer(conf Conf, db *database.DB, privKey []byte) *http.Server {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
// theme styles
|
// theme styles
|
||||||
r.GET("/theme/dark.css", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
r.GET("/theme/style.css", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||||
http.ServeContent(rw, req, "dark.css", time.Now(), bytes.NewReader(theme.DarkThemeCss))
|
http.ServeContent(rw, req, "style.css", time.Now(), bytes.NewReader(theme.ThemeCss))
|
||||||
})
|
})
|
||||||
|
|
||||||
// login steps
|
// login steps
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
html, body {
|
|
||||||
background-color: #242424;
|
|
||||||
color: #eeeeee;
|
|
||||||
}
|
|
8
theme/style.css
Normal file
8
theme/style.css
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
html, body {
|
||||||
|
color-scheme: light dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (prefers-color-scheme: dark) {
|
||||||
|
background-color: #242424;
|
||||||
|
color: #eeeeee;
|
||||||
|
}
|
@ -2,5 +2,5 @@ package theme
|
|||||||
|
|
||||||
import _ "embed"
|
import _ "embed"
|
||||||
|
|
||||||
//go:embed dark.css
|
//go:embed style.css
|
||||||
var DarkThemeCss []byte
|
var ThemeCss []byte
|
||||||
|
Loading…
Reference in New Issue
Block a user