Eleventy + Tailwind Typography + Nightwind for dark mode #1725
Unanswered
keikhcheung
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Interesting… do you have a public repo somewhere? Curious how/where/if you’re calling the .init() and .toggle() methods. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I wonder if anyone has tried setting up Eleventy with Tailwind Typography and Nightwind for dark mode toggle. I cannot manage to get the toggle to run.
I have the following set-up:
and
If I manually change on
<html class="nightwind">
to"<html class="nightwind dark">
or<html class="nightwind light">
while inspecting the output code on browser, the colours are changing. But I just cannot figure out how to get the toggle up on a page to have it running.I realise the example given on Nightwind’s documentation is either for React or NextJS, and I suppose the code would have to be changed some way to be able to call the
node_modules/nightwind/helper.js
on a button on click. But, as a beginning, I cannot figure out how to do it.Any information would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions