1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-21 19:51:44 +01:00

[feat] simple theme: pure black theme style

This commit is contained in:
Bnyro 2024-09-20 16:44:53 +02:00 committed by Markus Heiser
parent cbf1e90979
commit e4b2823abd
6 changed files with 18 additions and 4 deletions

View File

@ -58,7 +58,7 @@
Name of the theme you want to use by default on your SearXNG instance. Name of the theme you want to use by default on your SearXNG instance.
``theme_args.simple_style``: ``theme_args.simple_style``:
Style of simple theme: ``auto``, ``light``, ``dark`` Style of simple theme: ``auto``, ``light``, ``dark``, ``black``
``results_on_new_tab``: ``results_on_new_tab``:
Open result links in a new tab by default. Open result links in a new tab by default.

View File

@ -441,7 +441,7 @@ class Preferences:
'simple_style': EnumStringSetting( 'simple_style': EnumStringSetting(
settings['ui']['theme_args']['simple_style'], settings['ui']['theme_args']['simple_style'],
locked=is_locked('simple_style'), locked=is_locked('simple_style'),
choices=['', 'auto', 'light', 'dark'] choices=['', 'auto', 'light', 'dark', 'black']
), ),
'center_alignment': BooleanSetting( 'center_alignment': BooleanSetting(
settings['ui']['center_alignment'], settings['ui']['center_alignment'],

View File

@ -55,6 +55,7 @@ STYLE_NAMES = {
'AUTO': 'auto', 'AUTO': 'auto',
'LIGHT': 'light', 'LIGHT': 'light',
'DARK': 'dark', 'DARK': 'dark',
'BLACK': 'black',
} }
BRAND_CUSTOM_LINKS = { BRAND_CUSTOM_LINKS = {

View File

@ -18,7 +18,7 @@ searx_dir = abspath(dirname(__file__))
logger = logging.getLogger('searx') logger = logging.getLogger('searx')
OUTPUT_FORMATS = ['html', 'csv', 'json', 'rss'] OUTPUT_FORMATS = ['html', 'csv', 'json', 'rss']
SXNG_LOCALE_TAGS = ['all', 'auto'] + list(l[0] for l in sxng_locales) 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 = { CATEGORIES_AS_TABS = {
'general': {}, 'general': {},
'images': {}, 'images': {},

View File

@ -229,6 +229,14 @@
--color-doc-code-background: #4d5a6f; --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) /// Dark Theme (autoswitch based on device pref)
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root.theme-auto { :root.theme-auto {
@ -241,6 +249,11 @@
.dark-themes(); .dark-themes();
} }
:root.theme-black {
.dark-themes();
.black-themes();
}
/// General Size /// General Size
@results-width: 45rem; @results-width: 45rem;
@results-sidebar-width: 25rem; @results-sidebar-width: 25rem;

View File

@ -19,7 +19,7 @@
<legend id="pref_simple_style">{{- _('Theme style') -}}</legend>{{- '' -}} <legend id="pref_simple_style">{{- _('Theme style') -}}</legend>{{- '' -}}
<div class="value">{{- '' -}} <div class="value">{{- '' -}}
<select name="simple_style" aria-labelledby="pref_simple_style"> <select name="simple_style" aria-labelledby="pref_simple_style">
{%- for name in ['auto', 'light', 'dark'] -%} {%- for name in ['auto', 'light', 'dark', 'black'] -%}
<option value="{{ name }}" <option value="{{ name }}"
{%- if name == preferences.get_value('simple_style') %} selected="selected" {%- endif -%}> {%- if name == preferences.get_value('simple_style') %} selected="selected" {%- endif -%}>
{{- _(name) | capitalize -}} {{- _(name) | capitalize -}}