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

Customization #2

Open
synpse opened this issue Apr 19, 2024 · 3 comments
Open

Customization #2

synpse opened this issue Apr 19, 2024 · 3 comments

Comments

@synpse
Copy link

synpse commented Apr 19, 2024

How can I customize a theme? I can probably override existing themes, but can I create a new one? If yes, then how?

@victor-lillo
Copy link
Owner

Hello!

Just create a CSS class and pass it through childrenClassName. There, you can override the custom properties to customize the theme.

By the way, I'm working on new version of this package, feel free to suggest features if you want :)

Thanks!

@synpse
Copy link
Author

synpse commented Apr 20, 2024

I'm a little bit confused on how to do it. Could you give me an example please? Thank you for your support!

@victor-lillo
Copy link
Owner

Sure, @synpse!

Follow this steps:

  1. Create a CSS class in one of your stylesheets with the custom theme you want. For example:
.custom-confirm-toast-theme {
  --confirm-toast-bg: aquamarine;
  --confirm-toast-msg-color: purple;
  --confirm-toast-icon-color: black;
  --confirm-toast-btn-yes-color: lightgreen;
  --confirm-toast-btn-no-color: pink;
  --confirm-toast-btn-yes-bg: green;
  --confirm-toast-btn-no-bg: crimson;
  --confirm-toast-btn-hover: 0.9;
}
  1. Pass this class name to the childrenClassname property, like this:
<ConfirmToast
  childrenClassName='custom-confirm-toast-theme'
  // Rest of the props you need
>
  <button>Your component</button>
</ConfirmToast>

And with this you are done!

image

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