From a631f77401a0a20ae98ae472482d0e4b912d4c60 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 2 Oct 2024 18:06:29 +0200 Subject: [PATCH] [mod] favicons: simplify RTL in template & CSS Comes from a sughgestion in: - https://github.com/searxng/searxng/pull/3727#issuecomment-2388998803 Suggested-by: Bnyro Signed-off-by: Markus Heiser --- .../themes/simple/src/less/style-ltr.less | 4 ---- .../themes/simple/src/less/style-rtl.less | 8 +++---- .../static/themes/simple/src/less/style.less | 5 +++++ searx/templates/simple/macros.html | 21 +++++++------------ 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/searx/static/themes/simple/src/less/style-ltr.less b/searx/static/themes/simple/src/less/style-ltr.less index 5d8c5dbe5..6f7218b02 100644 --- a/searx/static/themes/simple/src/less/style-ltr.less +++ b/searx/static/themes/simple/src/less/style-ltr.less @@ -82,8 +82,4 @@ transform: scale(1, 1); } -.favicon { - margin: 0 8px 0 0; -} - @import "style.less"; diff --git a/searx/static/themes/simple/src/less/style-rtl.less b/searx/static/themes/simple/src/less/style-rtl.less index aa663436f..8e2634d34 100644 --- a/searx/static/themes/simple/src/less/style-rtl.less +++ b/searx/static/themes/simple/src/less/style-rtl.less @@ -94,12 +94,12 @@ direction: initial; text-align: right; + .result .url_header { + direction: rtl; + } + .result .url_wrapper { justify-content: end; - - .favicon { - margin: 0 0 0 8px; - } } } diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.less index 29ae4039e..857ea4a28 100644 --- a/searx/static/themes/simple/src/less/style.less +++ b/searx/static/themes/simple/src/less/style.less @@ -232,6 +232,11 @@ article[data-vim-selected].category-social { } } + .url_header { + display: flex; + gap: 0.5rem; + } + .url_wrapper { display: flex; align-items: center; diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 858ee2d7e..a6c1f98ab 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -20,20 +20,15 @@ {% macro result_header(result, favicons, image_proxify) -%}
- {{- result_open_link(result.url, "url_wrapper") -}} - {% if not rtl %} - {%- if favicon_resolver != "" %} -
- {%- endif -%} - {%- endif -%} - {%- for part in get_pretty_url(result.parsed_url) -%} - {{- part -}} - {%- endfor %} - {% if rtl %} - {%- if favicon_resolver != "" %} -
- {%- endif -%} + {{- result_open_link(result.url, "url_header") -}} + {%- if favicon_resolver != "" %} +
{%- endif -%} +
+ {%- for part in get_pretty_url(result.parsed_url) -%} + {{- part -}} + {%- endfor %} +
{{- result_close_link() -}} {%- if result.thumbnail %}{{ result_open_link(result.url) }}{{ result_close_link() }}{% endif -%}

{{ result_link(result.url, result.title|safe) }}