@ysms/ts-darkmode
v1.3.0
Published
A tiny library for handling dark mode on browsers.
Downloads
10
Readme
@ysms/ts-darkmodejs
🌙 How about change your web to darkmode?
🎯 Getting started
npm install @ysms/ts-darkmode
import Darkmode from "@ysms/ts-darkmode";
👀 How to use
// This creates a dark mode toggle button on your web.
const darkmode = new Darkmode({ content: "🌓" });
darkmode.activeDark();
🌈 Setting Options
// it's all default value
{
bottom: "30px", // Button's bottom position
right: "30px", // You can choose between right and left
left: "unset",
transitionTime: "0.3s", // Transition Time
backgroundColor: "#fff", // Light mode background color setting
buttonDarkColor: "#141414", // Dark mode button color
buttonLightColor: "#fff", // Light mode button color
content: "🌓", // Content in button
saveInCookies: true, // If you want to remember whether it's dark mode or not, write this section true or false
buttonWidth: "3rem", // Button size
buttonHeight: "3rem", // Button size
}
<!-- add 'darkmode-ignore' class-->
<div class="darkmode-ignore"><img href="@@@"></div>
🪄 License
Copyright 2022. YunMinSeok&ChoYeSeul(ysms) all rights reserved.