diff --git a/assets/css/app.css b/assets/css/app.css index 53a8819..f802cb0 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -25,6 +25,13 @@ } } +/* + Invert prose styles based on the variant of the theme. +*/ +:root[data-variant=dark] .prose { + @apply prose-invert; +} + /* Set appropriate width for identity icons */ a[rel] svg { width: 1em; diff --git a/lib/chiya_web/components/layouts.ex b/lib/chiya_web/components/layouts.ex index a49bec1..48692c0 100644 --- a/lib/chiya_web/components/layouts.ex +++ b/lib/chiya_web/components/layouts.ex @@ -2,4 +2,11 @@ defmodule ChiyaWeb.Layouts do use ChiyaWeb, :html embed_templates "layouts/*" + + @doc """ + Defines which themes are light and which are dark themes. + This influences the prose styles in app.css. + """ + def theme_variant(:default), do: "light" + def theme_variant(:roguelight), do: "dark" end diff --git a/lib/chiya_web/components/layouts/root_public.html.heex b/lib/chiya_web/components/layouts/root_public.html.heex index 77e8371..9568aa1 100644 --- a/lib/chiya_web/components/layouts/root_public.html.heex +++ b/lib/chiya_web/components/layouts/root_public.html.heex @@ -1,5 +1,5 @@ - +