Skip to content

include this script to set the bootstrap 5.3 dark-mode automatically based on system settings

License

Notifications You must be signed in to change notification settings

CzompiSoftware/bootstrap-auto-dark-mode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bootstrap-auto-dark-mode

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

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

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

    <html lang="en" data-bs-theme="auto">
        <head>
            <!-- your code -->
            <script src="./src/bootstrap-auto-dark-mode.js"></script>
        </head>
        <!-- your code -->
        <!-- […] -->

About

include this script to set the bootstrap 5.3 dark-mode automatically based on system settings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%