diff --git a/README.md b/README.md index ee8e78c..d201623 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,19 @@ # bootstrap-auto-dark-mode -Include this script to set the bootstrap >= 5.3 dark-mode automatically based on system settings. +This script adds the missing auto-dark mode to the new theme feature of Bootstrap 5.3. -The mode will switch automatically, also when the user changes the system settings while the page is shown. +It switches the Bootstrap theme automatically between light and dark mode, depending on the system settings, if you set the `data-bs-theme` attribute of your <html> to `auto`. ## Usage -```html - -``` +Use it by just including `bootstrap-auto-dark-mode.js` in your header and setting `data-bs-theme` to `auto`. +```html + + + + + + + … +``` diff --git a/index.html b/index.html index 18c9f2e..3fcf44d 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + @@ -12,14 +12,33 @@

bootstrap-auto-dark-mode

-

This script automatically switches the Bootstrap theme between light and dark mode, depending on the system settings.

+

This script adds an auto-dark mode to the new theme feature of Bootstrap 5.3.

-

Use it by just including bootstrap-auto-dark-mode.js in your header.

+

It switches the Bootstrap theme automatically between light and dark mode, depending on the system settings, if + you set the data-bs-theme attribute of your <html> to auto.

+ +

Use it by just including bootstrap-auto-dark-mode.js in your header and setting data-bs-theme to auto.

- <script src="./src/bootstrap-auto-dark-mode.js"></script> +
+    <html data-bs-theme="auto">
+        <head>
+            […]
+            <script src="./src/bootstrap-auto-dark-mode.js"></script>
+        </head>
+        […]
+    
+

Switch manually

+ + + + diff --git a/package.json b/package.json index b07993f..9a751fa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bootstrap-auto-dark-mode", "version": "1.0.1", - "description": "Switches the bootstrap >= 5.3 dark-mode automatically based on system settings.", + "description": "Adds the missing auto dark mode to Bootstrap >= 5.3, which switches automatically, based on system settings.", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1"