mirror of
https://github.com/1f349/lavender.git
synced 2024-12-22 07:34:06 +00:00
Add dark mode to UIs
This commit is contained in:
parent
03df1556e7
commit
78e144891a
@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{.ServiceName}}</title>
|
||||
<link rel="stylesheet" href="/theme/style.css">
|
||||
<script>
|
||||
let loginData = {
|
||||
target:{{.TargetOrigin}},
|
||||
|
@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{.ServiceName}}</title>
|
||||
<link rel="stylesheet" href="/theme/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{.ServiceName}}</title>
|
||||
<link rel="stylesheet" href="/theme/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
@ -1,9 +1,11 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/1f349/cache"
|
||||
"github.com/1f349/lavender/issuer"
|
||||
"github.com/1f349/lavender/theme"
|
||||
"github.com/1f349/mjwt"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"github.com/rs/cors"
|
||||
@ -68,6 +70,10 @@ func NewHttpServer(conf Conf, signer mjwt.Signer) *HttpServer {
|
||||
r.POST("/popup", hs.flowPopupPost)
|
||||
r.GET("/callback", hs.flowCallback)
|
||||
|
||||
r.GET("/theme/style.css", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||
http.ServeContent(rw, req, "style.css", time.Now(), bytes.NewReader(theme.DefaultThemeCss))
|
||||
})
|
||||
|
||||
// setup CORS options for `/verify` and `/refresh` endpoints
|
||||
var corsAccessControl = cors.New(cors.Options{
|
||||
AllowOriginFunc: func(origin string) bool {
|
||||
|
3
theme/style.css
Normal file
3
theme/style.css
Normal file
@ -0,0 +1,3 @@
|
||||
html, body {
|
||||
color-scheme: light dark;
|
||||
}
|
6
theme/theme.go
Normal file
6
theme/theme.go
Normal file
@ -0,0 +1,6 @@
|
||||
package theme
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed style.css
|
||||
var DefaultThemeCss []byte
|
Loading…
Reference in New Issue
Block a user