casesandberg / react-color

:art: Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
http://casesandberg.github.io/react-color/
MIT License
12k stars 915 forks source link

RTL support #359

Open sergop321 opened 7 years ago

sergop321 commented 7 years ago

Is there any planning for supporting strings wi RTL direction inside build in pickers? Update: Putting direction: rtl on page will effect pickers (They won't look good), So may be enforce direction ltr on all pickers?

casesandberg commented 7 years ago

What do you think about making the pickers enforce ltr and adding a direction prop on the component to override it to rtl? I can make sure the components dont get messed up when rtl is set.

<ChromePicker direction="rtl" />

Also, I've been planning to add i18n to the project as well, is this something that would be useful to you?

sergop321 commented 7 years ago

I think as an api it more clear to name the prop, rtl or isRtl. It is not clear from the name what direction mean <ChromePicker rtl={true} /> Most of the libraries I saw take this approach.

As a native Hebrew speaker I can tell you it doesn't make sense to translate the colors to native language, There is no translation for RGB, HEX, R(for red), G(for green), B(for blue) - May be in other languages there are but not in Hebrew.

The only exception is Photoshop picker, which has some words that will be nice if were customizable. (I am not sure you need the whole I18 for just customize 4 words - (new, current, ok, cancel).

I am using the Compact picker so these won't be useful for me.

casesandberg commented 7 years ago

Ah! rtl as a prop makes a bunch of sense. I will add it to the queue!

Hussam3bd commented 4 years ago

Hey guys, this is been added? or not? I tried to set direction="rtl" and it didn't work any help?