gatsby-plugin-dark-mode
gatsby-plugin-dark-mode copied to clipboard
Plugin option added for adding class toggle position to html tag instead of body
This added an option for user to change the class location from body
to html
tag.
Explanation
If user don't add any option it will work as its currently do. They have option for adding a optional option in the gatsby-config.js
as shown below.
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-dark-mode`,
options: {
node: "html",
},
},
],
};
Why its useful ?
I use tailwindCSS for all of my projects and if I want to add base style for the dark mode in the body
tag it does not work.