Package Exports
- @andreasrisager/darkmode
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@andreasrisager/darkmode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
DarkMode
MAKE YOUR WEBSITE CHANGE BETWEEN DARK MODE OR LIGHT MODE WITH LOCALSTORAGE
Usage • Get Started • License
USAGE
Install with npm i @andreasrisager/darkmode
Get Started
Javascript
import darkMode from "./node_modules/@andreasrisager/darkmode/index.js";
darkMode();
HTML
<label class="theme-switch" for="darkmode">
<input type="checkbox" id="darkmode">
Dark Mode
</label>
<script type="module" src=""></script>
CSS
[data-theme="dark"] {
color: #e9e9e9;
background-color: #1E1E1E;
}
License
MIT