Making Brand Header RTL compatible

How can we make this component to be compatible with RTL websites?

Few CSS customization can make this RTL compatible. I will work on it.

4 Likes

The component is not compatible with rtl websites. What should we do?

I tried it before. But it demanded more changes than I expected. It’s not in my current roadmap. pr-welcome.

3 Likes

I can submit a PR however I just don’t know how can I get the direction of discourse as a variable in theme component.

1 Like

In RTL layout <html> tag will include the CSS class rtl. You can do the customization based on it. If needed you can also check it in JS code by calling const isRTL = $("html").hasClass("rtl");.

1 Like

Sorry I didn’t understand you correctly. I just need to add a variable in common.scss file that indicates discourse global direction. I didn’t find such variable here:

If I have that variable in common.scss the customization would be pretty straightforward. Otherwise I don’t know how to do it.

Yes, we don’t have a global CSS variable I guess. You should check rtl.scss file to understand howto customize.

I submitted a pr

https://github.com/discourse/discourse-brand-header/pull/3

3 Likes

It’s merged. Thanks for the PR :heart:.

5 Likes