From e4b2823abdd649325308489538b994b341c13fa3 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 20 Sep 2024 16:44:53 +0200 Subject: [PATCH] [feat] simple theme: pure black theme style --- docs/admin/settings/settings_ui.rst | 2 +- searx/preferences.py | 2 +- searx/searxng.msg | 1 + searx/settings_defaults.py | 2 +- .../static/themes/simple/src/less/definitions.less | 13 +++++++++++++ searx/templates/simple/preferences/theme.html | 2 +- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/admin/settings/settings_ui.rst b/docs/admin/settings/settings_ui.rst index 1a6df9a17..86cd9d5bf 100644 --- a/docs/admin/settings/settings_ui.rst +++ b/docs/admin/settings/settings_ui.rst @@ -58,7 +58,7 @@ Name of the theme you want to use by default on your SearXNG instance. ``theme_args.simple_style``: - Style of simple theme: ``auto``, ``light``, ``dark`` + Style of simple theme: ``auto``, ``light``, ``dark``, ``black`` ``results_on_new_tab``: Open result links in a new tab by default. diff --git a/searx/preferences.py b/searx/preferences.py index b4a10899e..4b7494ac2 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -441,7 +441,7 @@ class Preferences: 'simple_style': EnumStringSetting( settings['ui']['theme_args']['simple_style'], locked=is_locked('simple_style'), - choices=['', 'auto', 'light', 'dark'] + choices=['', 'auto', 'light', 'dark', 'black'] ), 'center_alignment': BooleanSetting( settings['ui']['center_alignment'], diff --git a/searx/searxng.msg b/searx/searxng.msg index 013be2aff..a4bfb038a 100644 --- a/searx/searxng.msg +++ b/searx/searxng.msg @@ -55,6 +55,7 @@ STYLE_NAMES = { 'AUTO': 'auto', 'LIGHT': 'light', 'DARK': 'dark', + 'BLACK': 'black', } BRAND_CUSTOM_LINKS = { diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index 6786a78c4..7daf4cc20 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -18,7 +18,7 @@ searx_dir = abspath(dirname(__file__)) logger = logging.getLogger('searx') OUTPUT_FORMATS = ['html', 'csv', 'json', 'rss'] SXNG_LOCALE_TAGS = ['all', 'auto'] + list(l[0] for l in sxng_locales) -SIMPLE_STYLE = ('auto', 'light', 'dark') +SIMPLE_STYLE = ('auto', 'light', 'dark', 'black') CATEGORIES_AS_TABS = { 'general': {}, 'images': {}, diff --git a/searx/static/themes/simple/src/less/definitions.less b/searx/static/themes/simple/src/less/definitions.less index 45d5c878d..7d946f40e 100644 --- a/searx/static/themes/simple/src/less/definitions.less +++ b/searx/static/themes/simple/src/less/definitions.less @@ -229,6 +229,14 @@ --color-doc-code-background: #4d5a6f; } +.black-themes() { + --color-base-background: #000; + --color-base-background-mobile: #000; + --color-header-background: #000; + --color-footer-background: #000; + --color-sidebar-background: #000; +} + /// Dark Theme (autoswitch based on device pref) @media (prefers-color-scheme: dark) { :root.theme-auto { @@ -241,6 +249,11 @@ .dark-themes(); } +:root.theme-black { + .dark-themes(); + .black-themes(); +} + /// General Size @results-width: 45rem; @results-sidebar-width: 25rem; diff --git a/searx/templates/simple/preferences/theme.html b/searx/templates/simple/preferences/theme.html index 78920b46e..1fdaeac12 100644 --- a/searx/templates/simple/preferences/theme.html +++ b/searx/templates/simple/preferences/theme.html @@ -19,7 +19,7 @@ {{- _('Theme style') -}}{{- '' -}}
{{- '' -}}