From 81b31ced7dff705a9b44015e592ad754a1609fb8 Mon Sep 17 00:00:00 2001 From: Cade Scroggins Date: Thu, 24 Feb 2022 13:07:22 -0800 Subject: [PATCH] add theme support --- index.html | 213 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 147 insertions(+), 66 deletions(-) diff --git a/index.html b/index.html index 34e4d55..c1b72a5 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,20 @@
  • @@ -1343,8 +1415,15 @@ } _setColorsFromQuery(query) { - const color = this._parseQuery(query).color; - this._formEl.style.background = color || ''; + const { color } = this._parseQuery(query); + + if (color) { + this._formEl.style.background = color; + $.bodyClassAdd('color'); + } else { + this._formEl.style.background = ''; + $.bodyClassRemove('color'); + } } _submitForm(e) { @@ -1367,6 +1446,8 @@ } } + $.bodyClassAdd(CONFIG.theme); + const help = new Help({ commands: CONFIG.commands, newTab: CONFIG.queryNewTab,