diff --git a/_locales/en/messages.json b/_locales/en/messages.json index bb4478b..e18d299 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -665,6 +665,22 @@ "description": "Preferences/General", "message": "Try to find links in the website text (slower)" }, + "pref_theme": { + "description": "label text", + "message": "Theme:" + }, + "pref_theme_dark": { + "description": "option text", + "message": "Dark" + }, + "pref_theme_default": { + "description": "option text", + "message": "System/Browser default" + }, + "pref_theme_light": { + "description": "option text", + "message": "Light" + }, "pref_ui": { "description": "Preferences/General; group text", "message": "User Interface" diff --git a/data/prefs.json b/data/prefs.json index a164d1e..042930f 100644 --- a/data/prefs.json +++ b/data/prefs.json @@ -17,6 +17,7 @@ "remove-missing-on-init": false, "retries": 5, "retry-time": 10, + "theme": "default", "limits": [ { "domain": "*", diff --git a/style/common.css b/style/common.css index f6624db..d00a265 100644 --- a/style/common.css +++ b/style/common.css @@ -42,32 +42,30 @@ --popup-color: #0c0c0d; } -@media (prefers-color-scheme: dark) { - :root { - --add-color: lightblue; - --general-bgcolor: #2A2A2E; - --general-border-color: rgb(85, 85, 85); - --general-button-bgcolor-hover: black; - --general-button-bgcolor: rgb(36, 36, 36); - --general-button-color: white; - --general-color: rgb(249, 249, 250); - --menu-bgcolor: black; - --menu-bgcolor-hover: #1a6bce; - --table-bgcolor: #1A1A1E; - --table-head-bgcolor: #3A3A3E; - --toolbar-bg-color: rgb(202, 108, 0); - --status-icon-color: #b9b9b9; - --status-icon-color-hover: #e2e2e2; - --tile-url: url(tile-dark.png?3); - --toolbar-border: 1px solid rgba(30, 30, 30, 0.5); - --file-icon-image-color: rgb(21, 130, 197); - --popup-bgcolor: #4a4a4f; - --popup-color: rgb(249, 249, 250); - --general-button-shadow: 0px 0px 7px 1px rgba(128,128,128,0.8); - } - a { - color: lightblue; - } + html.dark { + --add-color: lightblue; + --general-bgcolor: #2A2A2E; + --general-border-color: rgb(85, 85, 85); + --general-button-bgcolor-hover: black; + --general-button-bgcolor: rgb(36, 36, 36); + --general-button-color: white; + --general-color: rgb(249, 249, 250); + --menu-bgcolor: black; + --menu-bgcolor-hover: #1a6bce; + --table-bgcolor: #1A1A1E; + --table-head-bgcolor: #3A3A3E; + --toolbar-bg-color: rgb(202, 108, 0); + --status-icon-color: #b9b9b9; + --status-icon-color-hover: #e2e2e2; + --tile-url: url(tile-dark.png?3); + --toolbar-border: 1px solid rgba(30, 30, 30, 0.5); + --file-icon-image-color: rgb(21, 130, 197); + --popup-bgcolor: #4a4a4f; + --popup-color: rgb(249, 249, 250); + --general-button-shadow: 0px 0px 7px 1px rgba(128,128,128,0.8); +} + html.dark a { + color: lightblue; } html[data-platform="mac"] { diff --git a/windows/manager.ts b/windows/manager.ts index 76553da..fc44c5c 100644 --- a/windows/manager.ts +++ b/windows/manager.ts @@ -9,6 +9,7 @@ import { runtime } from "../lib/browser"; import { Promised } from "../lib/util"; import { PromiseSerializer } from "../lib/pserializer"; import { Keys } from "./keys"; +import "./theme"; const $ = document.querySelector.bind(document); diff --git a/windows/popup.ts b/windows/popup.ts index 2ece29a..9b1abf0 100644 --- a/windows/popup.ts +++ b/windows/popup.ts @@ -2,6 +2,7 @@ // License: MIT import { localize } from "../lib/i18n"; +import "./theme"; declare let browser: any; declare let chrome: any; diff --git a/windows/prefs.html b/windows/prefs.html index 668e68f..ce11ae6 100644 --- a/windows/prefs.html +++ b/windows/prefs.html @@ -51,6 +51,13 @@