From 50fdaf3e06968714c2f3c69497cef86568f7f46b Mon Sep 17 00:00:00 2001 From: GHX5T-SOL Date: Wed, 20 May 2026 21:30:45 +0200 Subject: [PATCH] Respect system theme preference --- assets/css/app.css | 2 ++ assets/tailwind.config.js | 1 + lib/algora_web/components/layouts/root.html.heex | 12 +++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/assets/css/app.css b/assets/css/app.css index e18f8c5f8..be4e60726 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -172,6 +172,7 @@ input:-webkit-autofill:active { @layer base { :root { + color-scheme: light; --background: 255 0% 95%; --foreground: 255 0% 0%; --card: 255 0% 90%; @@ -231,6 +232,7 @@ input:-webkit-autofill:active { --radius: 0.5rem; } .dark { + color-scheme: dark; --background: 240 10% 3.9%; --foreground: 0 0% 98%; --card: 240 10% 3.9%; diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index 8a0cc4fa9..5d31cf9cd 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -8,6 +8,7 @@ const fs = require("fs"); const colors = require("tailwindcss/colors"); module.exports = { + darkMode: "class", content: [ "./js/**/*.js", "./js/**/*.ts", diff --git a/lib/algora_web/components/layouts/root.html.heex b/lib/algora_web/components/layouts/root.html.heex index fd8349ce6..b498a9939 100644 --- a/lib/algora_web/components/layouts/root.html.heex +++ b/lib/algora_web/components/layouts/root.html.heex @@ -50,6 +50,16 @@ + @@ -71,7 +81,7 @@ rel="stylesheet" /> - + {@inner_content}