Skip to content

サイトのダークモード等のデザインモードの状態を管理するjavascriptモジュール

License

Notifications You must be signed in to change notification settings

TakuyaKinoshita/JS_DarkMode

Repository files navigation

Theme.jS

setup

Download this repositry

<link rel="stylesheet" href="./main.css">
<script src="./theme.js"></script>
<script>
  // use simple
  var theme = new theme()

  // add theme
  var theme2 = new theme(['default', 'theme2'])
</script>
:root[theme="light"] {
  --bgcolor: #f8f9fa;
  --textcolor: #343a40;
}
:root[theme="dark"] {
  --bgcolor: #343a40;
  --textcolor: #f8f9fa;
}
:root[theme="theme2"] {
  --bgcolor: #00b1ae;
  --textcolor: #495057;
}

body {
  background-color: var(--bgcolor);
  color: var(--textcolor);
}

please see demo

demo URL

LICENSE

This software is released under the MIT License, see LICENSE.txt.

About

サイトのダークモード等のデザインモードの状態を管理するjavascriptモジュール

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published