14 lignes
475 o
HTML
14 lignes
475 o
HTML
{{define "night_theme_init"}}
|
|
<script type="text/javascript">
|
|
// Night mode
|
|
var night = localStorage.getItem("night");
|
|
var darkStyleLink = document.createElement('link');
|
|
darkStyleLink.id = "style-dark";
|
|
darkStyleLink.rel = "stylesheet";
|
|
darkStyleLink.type = "text/css";
|
|
darkStyleLink.href = "/css/style-night.css"
|
|
if (night == "true") {
|
|
document.getElementsByTagName("head")[0].appendChild(darkStyleLink);
|
|
}
|
|
</script>
|
|
{{end}}
|