-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple theme: implement RTL #750
Conversation
f242c9d
to
8e3bf7d
Compare
@dalf I added some small fixes on top of your branch; feel free to change/throw away/whatever 👍 The things that still need attention:
|
The less grunt runner silently ignore missing files and continue with the build[1]:: Running "less:production" (less) task >> Destination css/searxng.min.css not written because no source files were found. >> 1 stylesheet created. >> 1 sourcemap created. Add filter function that calls grunt.fail() if the scr file does not exists. [1] searxng#750 (comment) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
610e77b
to
2e35cf9
Compare
The URL are displayed left to right but aligned on the right. Google displays each URL "part" from right to left: Bings displays the full URL from left to right (or is it broken?): The Google version requires to modify get_pretty_url and the CSS (I'm not sure how to do that).
#369 needs to be fixed first |
The less grunt runner silently ignore missing files and continue with the build[1]:: Running "less:production" (less) task >> Destination css/searxng.min.css not written because no source files were found. >> 1 stylesheet created. >> 1 sourcemap created. Add filter function that calls grunt.fail() if the scr file does not exists. [1] searxng#750 (comment) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except /preferences
the RTL text orientation LGTM.
I think this PR is a huge improvement to what we have.
I left some comments with my thoughts ...
* disable declaration-empty-line-before https://stylelint.io/user-guide/rules/list/declaration-empty-line-before/ this change allows to mix CSS declarations and LESS mixins without empty lines: #something { display: flex; .ltr-left(60rem); // no mandatory empty line before this one } * disable no-invalid-position-at-import-rule https://stylelint.io/user-guide/rules/list/no-invalid-position-at-import-rule/ this change allows to declare some mixins and then import another .less file: for example: .ltr-left(@offset) { left: @offset; } @import "style.less";
* mirror all inline SVGs so that direction SVGs display correctly on RTL * set the bold list element in info box to RTL so the colon gets displayed on the right side * set correct .ltr function for the left border on the search button in #q * move text to the right in autocomplete * move search form in lign with result article on RTL * add the correct padding for img thumbnails in categories like music on RTL * apply RTL to result table for map results * align text in tables part of /preferences on RTL * move burger menu on index page to the left on RTL * fix positioning of drop down arrow on select boxes on RTL * align result URL on the right (written LTR) * align vim hotkeys help on the left since it is not translated * image detail: * labels (author, format, URL, etc...) are written on the right, values are on the left. * URL are written LTR and overflow on the right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is a huge improvement to what we have.
Lets merge this PR, the /preferences
page can be fixed in another PR.
I have a backup if for reason it was not a good choice
from my side is no longer need for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
(We should work on making LTR text in an RTL layout to be displayed as LTR in another PR)
Looks awesome!
In bing, it's reversed. URL must always be LTR and NOT affected by RTL |
What does this PR do?
This PR implements the RTL text direction in the simple theme.
Modern browsers do most of the work, but margin / padding / border and some other properties have to be manage manually.
The usual method seems to be:
IMO, this is error prone and require some copy / paste
There is the
margin-inline-start
property, but it seems to be supported only recently (except for FF), and it doesn't solve all cases (for examplefloat: right
).So this PR uses some LESS mixins:
In LTR version:
In this RTL version:
and so on for the different CSS properties.
Why is this change important?
Add support for RTL languages in the Simple theme.
How to test this PR locally?
Author's checklist
Issue list:
For the last one: I dont' know if there is a way to display LTR text aligned on the left, and RTL text aligned on the right only using CSS.
Currently, the only way I see is to detect the text direction in Python, and then add the
dir
HTML attribute.From that, it is possible to add some CSS to display the text either aligned on the right, either aligned on the left.
ping @GreenLunar
Related issues
Close #747