[Vuejs]-How to configure @nuxt/tailwind + typography with dark mode

3👍

Here is the boilerplate: https://github.com/kissu/nuxt-tailwind-typography-darkmode-boilerplate

It comes with:

This is basically an updated version of the tailwind configuration for the @nuxt/content-theme-docs without being stuck to write documentation files only. (there is maybe a way of doing this out of the box but I did not found it)

This configuration was heavily inspired by this awesome post from Adam: https://github.com/tailwindlabs/tailwindcss-typography/issues/69#issuecomment-752946920

I’m not sure what tailwindcss-dark-mode is really used for since it is not really active and that the few variants that I’ve tried are already working out of the box with Tailwind 2. But I found this interesting issue in case it may be helpful one day: https://github.com/ChanceArthur/tailwindcss-dark-mode/issues/37#issue-681948280

The current configuration (tailwind.config.js) is essentially relying on toggling buttons at the top of the page because of darkMode: 'class'. If you set it to media, you can either toggle it in your system or go to Chrome’s dev tools and ctrl + shift + p and choose your any prefers-color-scheme for testing purposes.

enter image description here

👤kissu

Leave a comment