cyntler / hamburger-react

Animated hamburger menu icons for React.js weighs only 1.5 KB.
https://hamburger-react.netlify.app
MIT License
963 stars 36 forks source link

Disable colour transition #42

Closed Nuno111 closed 3 years ago

Nuno111 commented 3 years ago

Hi there, I am using a dark mode toggle theme, and everything in my website changes colours straight away except the burger menu, is there any way for me to disable transition on colours?

Many thanks

Loving the togglers!

luukdv commented 3 years ago

Thanks! 💫

You can disable all the transitions with (<Hamburger duration={0}), but at the moment there is no API to do this on a property-basis. The only way would be with CSS:

.hamburger-react { ... }
Nuno111 commented 3 years ago

Thank you, will try it out once I figure out how to add custom class to tailwind =P

luukdv commented 3 years ago

@Nuno111 An example (style.css):

@tailwind base;
@tailwind components;
@tailwind utilities;

.hamburger-react {
  ...
}
Nuno111 commented 3 years ago

That's what I did but wasn't working 🤔