2018-01-07 21:42:19 +01:00
|
|
|
package webcontroller
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/julienschmidt/httprouter"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GlobalCSSHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
|
2018-01-08 12:06:38 +01:00
|
|
|
w.Header().Add("Content-Type", "text/css; charset=utf-8")
|
2018-01-07 21:42:19 +01:00
|
|
|
|
2018-03-27 23:11:43 +02:00
|
|
|
var textColor = "hsl(0, 0%, 75%)"
|
2018-01-07 21:42:19 +01:00
|
|
|
|
|
|
|
// Originals
|
2018-03-27 23:16:20 +02:00
|
|
|
var highlightColor = "hsl(89, 51%, 50%)"
|
|
|
|
var highlightColorDark = "hsl(89, 51%, 40%)"
|
2018-01-07 21:42:19 +01:00
|
|
|
|
|
|
|
// Purple scheme
|
|
|
|
// var highlightColor = "843384"
|
|
|
|
// var highlightColorDark = "672867"
|
|
|
|
|
|
|
|
var response = fmt.Sprintf(
|
|
|
|
`:root {
|
2018-03-27 23:11:43 +02:00
|
|
|
--text_color: %s;
|
|
|
|
--highlight_color: %s;
|
|
|
|
--highlight_color_dark: %s;
|
2018-01-07 21:42:19 +01:00
|
|
|
}
|
|
|
|
`,
|
|
|
|
textColor,
|
|
|
|
highlightColor,
|
|
|
|
highlightColorDark,
|
|
|
|
)
|
|
|
|
|
|
|
|
strings.NewReader(response).WriteTo(w)
|
|
|
|
}
|