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

Doesn't play well with TailwindCSS (or any other utility framework) #101

Closed
gremo opened this issue May 9, 2022 · 5 comments
Closed

Doesn't play well with TailwindCSS (or any other utility framework) #101

gremo opened this issue May 9, 2022 · 5 comments

Comments

@gremo
Copy link

gremo commented May 9, 2022

... because of the style background: linear-gradient(135deg, #73a5ff, #5477f5) applied by default.

TailwindCSS uses the bg- utility class to change the background color. Passing the option className doesn't work of course, because of the background property:

toastify

This is annoying because most of the time the primary purpose is to change the background color. Is there a way to unset (maybe using some options) the background itself, and use my bg-green-500 class?

@Shitric
Copy link

Shitric commented May 14, 2022

I think you can unset the background property for default and set className to bg-green-500. Maybe i'm wrong but give a change :)

@gremo
Copy link
Author

gremo commented May 16, 2022

@Shitric thanks for helping, but unset wins:

Immagine 2022-05-16 161546

@apvarun
Copy link
Owner

apvarun commented Jun 19, 2022

Importing the toastify css file before the tailwind layers in your CSS file would change the specificity as per your need.
Can you try it @gremo ?

@gremo
Copy link
Author

gremo commented Jun 27, 2022

@apvarun well that is not simple. I'm lazy loading the css needed by toastify-js... but I'll try it anyways!

@gremo
Copy link
Author

gremo commented Jun 28, 2022

Solved using important modifier this way: !bg-none !bg-cyan-500. But I still think there should better way. I'll close this for not polluting the issues.

@gremo gremo closed this as completed Jun 28, 2022
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