When exploring Tailwind CSS, it appears that specific colors need to be specified in classes like this:
<div class="bg-yellow-200 dark:bg-gray-800"></div>
However, I am interested in offering 10 different themes for users to choose from in my web app. These themes could include options like halloween
, summer
, winter
, and party
.
I understand that achieving this with regular CSS is straightforward, as shown below:
[data-theme="halloween"] {
--color-bg: #000;
--color-body: #757981;
}
<body data-theme="halloween"></div>
By then using JavaScript to alter the data-theme property, the theme can be changed.
Yet, I'm unsure how to accomplish this with Tailwind CSS since I couldn't find relevant information in the documentation.