-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
feat: Add RTL support #110
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @limitless-dev, thanks for your contribution. Just some suggestions
-
I think we can refactor to use logical properties here.
-
Some alignments are incorrect (I think this should be fixed using logical properties):
-
Add
dir
type toToaster
props
Hi @joaom00 - Thanks for taking the time to review!
I just checked again and it appears to work on Firefox but not Chrome!
Actually, that was my first approach but I realized I'll need to pass
Beside, that can be done through the <Toaster
style={{ direction: 'rtl' }}
/> So I focused on the styling issues for SVG and action button. |
Fixed the issue, RTL should now function correctly (limited to HTML direction only). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know if having the dir as prop for Toaster is a preferable approach
I think we can keep on html
only. (Maybe we can add a dir
prop to the Toaster
and in the website add an option to enable the RTL mode)
One thing missing is inverting [data-close-button]
as well and, if you don't mind, can you invert the position of the dismiss button in the Headless
example? Thanks
Something I'm in doubt is whether we should invert the position of the toast too 🤔
Hi @joaom00 , thanks for your comments. Priority of
Changes
Once we finalize this as stable, I'll add an example 👍 |
|
||
export type Direction = (typeof directions)[number]; | ||
|
||
export const Direction = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this and add it to the Readme instead
This is awesome, left one comment. Can we add tests for this as well? |
Hi @emilkowalski, thank you for your review.
|
Amazing, thank you so much for this |
please see this issue related |
This PR introduces RTL (Right-to-Left) support for the
Toaster
component.Related Issues
Changes:
Toaster
.Toaster
.<html dir='rtl'>
<Toaster dir='rtl' />
rtl
,ltr
,auto
Priority of direction (
dir
) :ltr
I know we can hack this with CSS, but it's so much nicer to have it built-in. Saves us from redoing it in every project.