Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down Expand Up @@ -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%;
Expand Down
1 change: 1 addition & 0 deletions assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const fs = require("fs");
const colors = require("tailwindcss/colors");

module.exports = {
darkMode: "class",
content: [
"./js/**/*.js",
"./js/**/*.ts",
Expand Down
12 changes: 11 additions & 1 deletion lib/algora_web/components/layouts/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
<link rel="apple-touch-icon" sizes="192x192" href="/images/logo-192px.png" />
<link rel="apple-touch-icon" sizes="512x512" href="/images/logo-512px.png" />

<script>
(() => {
try {
const theme = localStorage.getItem("theme");
const systemDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
const useDark = theme === "dark" || (!theme && systemDark);
document.documentElement.classList.toggle("dark", useDark);
} catch (_error) {}
})();
</script>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
</script>
Expand All @@ -71,7 +81,7 @@
rel="stylesheet"
/>
</head>
<body class="dark">
<body>
{@inner_content}
<div
:if={Application.get_env(:algora, :ingest_token)}
Expand Down