shadeed / rtl-styling

An extensive guide on how to style for RTL in CSS
https://rtlstyling.com/
MIT License
351 stars 19 forks source link

RTL style for code blocks? #13

Open slorber opened 3 years ago

slorber commented 3 years ago

Hi,

We implemented recently RTL support in Docusaurus and one of our early adopter gave this feedback:

Another point the direction of the codeblocks, they should be LTR

https://datagit.ir/docs/python/beginner/functions/function

image

The user added this custom CSS:

.codeBlockContent {
  direction: ltr !important;
}

I wasn't able to find a section about code blocks in the guide to help me figure out if I should hardcode all code blocks to LTR or not in the framework, or if RTL code blocks may make sense occasionally according to the code language or something?

My guess is that we should rather default to LTR and let the user use RTL opt-in eventually?

Currently rendering in RTL looks quite weird on Docusaurus :D

image

In such case where the code block has a title (may be a file path or a RTL language title), should the title be RTL or LTR ? Can it make sense to have the title RTL and code block LTR, and have some weird alignment?

Please let me know what you think ;)