Skip to content
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

Rtl Skin #7907

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Rtl Skin #7907

wants to merge 10 commits into from

Conversation

seyyedhasan6172
Copy link

#7883
hi
I change styles of the elastic theme directly to set it RTL.as you say in issue #7883 check the codes and say your opinion about how I change my code to be useful for your needs
I change default styles to rtl styles and add text-align:right and direction:rtl to htm,body tags in style .css

@alecpl
Copy link
Member

alecpl commented Feb 25, 2021

Sorry but this way I don't see what has changed in styles. You should not modify styles.css, but the less files.

@seyyedhasan6172 seyyedhasan6172 marked this pull request as ready for review March 4, 2021 20:59
I change .less files for Rtl, for changing styles I change styles.less and styles that imported in styles.less
,global.less
,layout.less
,common.less
,buttons.less
,jqueryui.less
,dialogs.less
,menu.less
,messages.less
,lists.less
,forms.less
,editor.less
 and so some other that imported in up .less files
@alecpl
Copy link
Member

alecpl commented Mar 8, 2021

Thanks. From the changes I see that this probably should be done in the same way we implemented dark mode (see dark.less). I.e. create rtl.less file and put all needed less changes under html.rtl class (or better html[dir=rtl]) and make sure to set the class/attribute with some code in the templates engine (depending on the selected language?).

create rtl.less file.
 I have created rtl.less like the dark.less .I have tested in other skin and its works. I change the html.rtl to html.dark-mode and I have import rtl.less instead of dark.less.
When I was clicked on the dark-mode button the direction changed to RTL and هt worked properly.
so. I want to change the direction according to the language. I see some functions in editor.js for detect language, if I detect the language in ui.js I can change the direction. I think I can implement like dark-mode scenario.
if you have an idea that what can I do please say it to me.
Thanks.
@seyyedhasan6172
Copy link
Author

Hello
I have created rtl.less like the dark.less .I have tested in other skin and its works. I change the html.rtl to html.dark-mode and I have import rtl.less instead of dark.less.
When I was clicked on the dark-mode button the direction changed to RTL and هt worked properly.
so. I want to change the direction according to the language. I see some functions in editor.js for detect language, if I detect the language in ui.js I can change the direction. I think I can implement like dark-mode scenario.
if you have an idea that what can I do please say it to me.
Thanks.

@seyyedhasan6172
Copy link
Author

hi
Have you checked the codes?
Were they in your opinion or not?
I put the codes inside the dark.less and the direction changed by pressing the theme button.

@alecpl
Copy link
Member

alecpl commented Apr 8, 2021

Could you remove changes that are not needed anymore?

@seyyedhasan6172
Copy link
Author

hi
what do you mean?
Currently the important file is rtl.less. Which changes should I delete?

@alecpl
Copy link
Member

alecpl commented Apr 14, 2021

See "Files changed" tab here. To review changes I have to see only these relevant.

This reverts commit deaf333.
…and direction:rtl to htm,body tags in style .css"

This reverts commit b96dc41.
This reverts commit a0ddc53.
@alecpl
Copy link
Member

alecpl commented Apr 18, 2021

Ok, so now before anyone can test this we need to add at the end of styles.less:

& when (@rtl-mode-enabled = true) {
    @import "rtl";
}

and define the variable in variables.less, where @dark-mode-enabled is.

Next steps:

  1. Set rtl class on the html element depending on the UI language of the current user (rcmail_output_html::_write()).
  2. Do we need to set dir="rtl" anywhere?
  3. Investigate if we need to do anything with TinyMCE. I.e. switch to RTL mode automatically. What if the edited content (e.g. a mail response) is in English, what if it's in Arabic (language detection territory).
  4. Investigate what other things need to be fixed/improved.

add condition for check @rtl-mode-enabled at the end of styles.less
add a function and call that for change direction
@seyyedhasan6172
Copy link
Author

I define @rtl-mode-enabled in variables.less,
add a condition for check @rtl-mode-enabled at the end of styles.less,
add a function and call that for change direction
if you change the language to Persian, you can see that direction changed.

@alecpl
Copy link
Member

alecpl commented Oct 2, 2021

This looks better and better. I didn't yet tested this, but do you have any feedback on points 2-4 from my last comment?

@Neustradamus
Copy link

@seyyedhasan6172: Have you progressed on your PR?

@alecpl has requested you comment on some points.

@@ -4244,6 +4248,14 @@ function rcube_elastic_ui()
rcmail.set_cookie(key, val, exp);
}
};

function changeDirection() {
lang = rcmail.env.locale;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var lang = rcmail.env.locale;
set var because js is restricted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants