Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there is any way to change close button position. #417

Closed
nisharmultani opened this issue May 16, 2024 · 3 comments
Closed

Is there is any way to change close button position. #417

nisharmultani opened this issue May 16, 2024 · 3 comments

Comments

@nisharmultani
Copy link

Describe the feature / bug 馃摑:

Steps to reproduce the bug 馃攣:

@UltimateGG
Copy link

In toast options, you can set the closeButton's className or style and override its left/right position.
Here's what I just did to flip it from the left to right side using CSS though:

  :where([data-sonner-toaster][dir='ltr'] button[data-close-button]) {
    --toast-close-button-start: auto;
    --toast-close-button-end: 0;
    --toast-close-button-transform: translate(35%, -35%);
  }

  :where([data-sonner-toaster][dir='rtl'] button[data-close-button]) {
    --toast-close-button-start: 0;
    --toast-close-button-end: auto;
    --toast-close-button-transform: translate(-35%, -35%);
  }

@nisharmultani
Copy link
Author

can you give me a proper solution, please

@emilkowalski
Copy link
Owner

You can target individual elements like so https://sonner.emilkowal.ski/styling#tailwind-css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants