st1020 / kita

Kita is a clean, elegant and simple blog theme for Zola.
https://st1020.github.io/kita/
MIT License
41 stars 12 forks source link

Adding a fix to automatically detect and apply the needed direction to text #7

Closed nimafanniasl closed 8 months ago

st1020 commented 8 months ago

Thank you for your contribution, but I don’t understand the problem that this PR needs to solve. Can you provide examples of changes before and after modification? BTW, you should not modify the main.css file directly, it is an automatically generated file, you should modify the app.css file instead.

nimafanniasl commented 8 months ago

Hey! Thanks. Look at these two pictures: Screenshot 2024-02-26 at 22-06-24 Some blog post - Blog And the markdown file for that picture: image

As you can see, the Persian text is not RTL and it's not correct. Also, if we set everything to RTL, the English text is gonna be messed up:

Screenshot 2024-02-26 at 22-09-11 Some blog post - Blog

But with this fix, it looks like this: Screenshot 2024-02-26 at 22-18-28 Some blog post - Blog

Also, unfortunately, I wasn't able to modify the app.css file to get the same results, but the CSS needed is just those 2 lines applying to everything :)

  text-align: start;
  unicode-bidi: plaintext;
st1020 commented 8 months ago

Ok, I get it. After modify app.css, you should run pnpm run build to rebuild main.css.

I fixed this problem in https://github.com/st1020/kita/commit/466255df5879f47072f542d810f0e29174cdd421 and tried to do some testing, but I'm not familiar with RTL languages, so please check if it solves your problem.

nimafanniasl commented 8 months ago

Hi! I tested the changes and everything is working :)

Thank you.