jjranalli / nightwind

An automatic, customisable, overridable Tailwind dark mode plugin
https://nightwindcss.com
MIT License
711 stars 45 forks source link

Don't remove custom transitions #32

Open quick007 opened 3 years ago

quick007 commented 3 years ago

I spent quite a bit trying to make a clean custom light/dark mode button, and the injected night wind transition ruins it. Can we have another css class (like nightwind-transition-prevent) or something?

jjranalli commented 3 years ago

Hi – Can you clarify what you mean with "ruins it"? Would disabling all transitions suit your needs, or do you want to disable them only on the button?

Anyway it seems a reasonable addition, will consider adding it in the next release!

quick007 commented 3 years ago

ruins it

The animation just doesn't play, and the "duration" tag on the animation also makes it take longer on just that component (because its fireing at the same time its switching the mode)

Would disabling all transitions suit your needs, or do you want to disable them only on the button?

Only on the thing with the class nightwind-transition-prevent on it. I believe disabling all transitions is already possible(?)

vesper8 commented 3 years ago

Would you mind sharing your clean dark mode toggle button @quick007 : )

quick007 commented 3 years ago

Would you mind sharing your clean dark mode toggle button @quick007 : )

I'm hesitant to call it clean (especially with it being partially broken...) but here ya go: https://github.com/wave-studio/JSBoard/blob/master/components/misc/mode-switcher.tsx

@vesper8

borispoehland commented 3 years ago

I have the same problem. The "nightwind-prevent" class doesn't stop the transition from happening, overriding my tailwind transition I set on the class

Bildschirmfoto von 2021-09-18 21-51-46

Here's an example. The transition happens despite nightwind-prevent.