@aiursoft/autodark.js
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

AutoDark.js

MIT licensed Pipeline stat ManHours npm npm

@aiursoft/autodark.js is a JavaScript library for detecting user's system dark mode and auto switch your website's theme.

Installation

Run the following command to install the most recent version of @aiursoft/autodark.js from npm:

npm install @aiursoft/autodark.js

Importing

Reference CSS

You also need to reference the CSS file in your HTML:

<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="./node_modules/@aiursoft/autodark.js/dist/css/autodark.min.css" />

Reference JavaScript

You also need to reference bootstrap's JavaScript file:

<script src="./node_modules/jquery/dist/jquery.min.js" defer></script>
<script src="./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" defer></script>
<script type="module">
  import { autoTheme } from './node_modules/@aiursoft/autodark.js/dist/esm/autodark.js'
  autoTheme()
</script>

How to build locally

npm install
npm run build

How to contribute

There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.

Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.

We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.

Readme

Keywords

none

Package Sidebar

Install

npm i @aiursoft/autodark.js

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

23.8 kB

Total Files

14

Last publish

Collaborators

  • anduin2017