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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Support for override button classes #20

Closed
mike1o1 opened this issue Jul 28, 2024 · 2 comments
Closed

Request: Support for override button classes #20

mike1o1 opened this issue Jul 28, 2024 · 2 comments

Comments

@mike1o1
Copy link

mike1o1 commented Jul 28, 2024

It would be nice if we could override the classes for the button markup, similar to how we are able to set the toast_class_fn. In my case, I'm setting dark mode specific background color (black), which kind of conflicts with the text-black/50 that's getting applied in the current markup.

Happy to submit a PR if others have interest in this.

@FranzVDB
Copy link

Would be nice, my hack was a global css selector that overrides the color on button.

@srcrip
Copy link
Owner

srcrip commented Dec 31, 2024

@mike1o1 @FranzVDB the option I would use is TW classes that deeply select, like if you wanted to make the button red for instance you could do: [&_button]:bg-red-400.

Of course you don't have to use TW, as @FranzVDB pointed out you can put a regular class called .toast on through toast_class_fn and select it with regular css:

.toast {
  button {
    background: red;
  }
}

I'll close this issue cause I think using CSS itself is a fine way of targeting the parts of the toast itself. If you find something that you can't do with just CSS for some reason feel free to reopen or open a new issue. Thank you!

@srcrip srcrip closed this as completed Dec 31, 2024
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