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 @@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>
+ […]
+
+