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

Can't override css module styles #97

Open
hemengke1997 opened this issue Aug 25, 2024 · 4 comments
Open

Can't override css module styles #97

hemengke1997 opened this issue Aug 25, 2024 · 4 comments

Comments

@hemengke1997
Copy link
Contributor

Grate lib! Respect!

classnames like toast-message which could not be override because they are css modules.

For better scalability, there are two ways to do this

  1. refactor css modules to global css and devleopers import the css file manualy
  2. add some classnames options then pass to toast-message component.

I think method one is better.

@almond-bongbong
Copy link
Owner

Thank you for your valuable input and the PR. I appreciate your effort to improve the library's flexibility.
Your suggestion to refactor CSS modules to global CSS does have merits, as you pointed out. It would simplify the overall code structure and make overriding styles more straightforward. However, we should also consider potential drawbacks:

Global CSS may lead to naming conflicts and unintended style overrides across the application.
We might lose the benefits of CSS modules, such as local scoping and automatic class name generation.

That being said, I agree that the benefits could outweigh the drawbacks in this case, especially for improving customization options for developers.

Before proceeding, I'd like to review the specific changes in your PR to ensure they align with our project's goals and don't introduce any unintended side effects.

Once again, thank you for your contribution. We'll carefully evaluate the proposed changes and get back to you soon with our decision or any additional questions we may have.

@hemengke1997
Copy link
Contributor Author

In fact, many popular react libraries are based on bem or cssinjs such as react-toastify. Personally, I don't think there is any need to worry about css conflicts. Both BEM and developers can avoid this problem.

However, it is up to you to decide whether to use the css module or global css. If there are other ways to achieve custom styles, you can also consider them.

In addition, I think it is necessary to solve the problem of closing timeout with fixed 300ms, because timeout is uncertain, and using onTransitionEnd is a relatively better way.

@almond-bongbong
Copy link
Owner

I agree with your opinion! I will review the code and implement the changes as soon as possible. Thank you!

@hemengke1997
Copy link
Contributor Author

Thank you for your reply and support.

If there is anything I need to intervene in, please feel free to contact me.

Thank you very much for your contribution to the open source community. This is a great library.

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

2 participants