mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
automatically apply system-wide theme preference for anonymous users
This commit is contained in:
parent
5c51775f94
commit
5b49eb0b9d
2 changed files with 5 additions and 0 deletions
|
@ -11,6 +11,8 @@ html lang="en"
|
|||
- else
|
||||
' Derpibooru
|
||||
link rel="stylesheet" href=stylesheet_path(@conn, @current_user)
|
||||
= if is_nil(@current_user) do
|
||||
link rel="stylesheet" href=dark_stylesheet_path(@conn) media="(prefers-color-scheme: dark)"
|
||||
link rel="icon" href="/favicon.ico" type="image/x-icon"
|
||||
link rel="icon" href="/favicon.svg" type="image/svg+xml"
|
||||
meta name="generator" content="philomena"
|
||||
|
|
|
@ -73,6 +73,9 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
def stylesheet_path(conn, _user),
|
||||
do: Routes.static_path(conn, "/css/default.css")
|
||||
|
||||
def dark_stylesheet_path(conn),
|
||||
do: Routes.static_path(conn, "/css/dark.css")
|
||||
|
||||
def theme_name(%{theme: theme}), do: theme
|
||||
def theme_name(_user), do: "default"
|
||||
|
||||
|
|
Loading…
Reference in a new issue