Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mdbootstrap/bootstrap-dark-mode

Responsive Dark Mode theme built with Bootstrap 5 with Dark Mode toggle button that switches between dark and light themes.
https://github.com/mdbootstrap/bootstrap-dark-mode

bootstrap bootstrap5 bootstrap5-template dark-mode dark-mode-toggle dark-theme theme

Last synced: about 1 month ago
JSON representation

Responsive Dark Mode theme built with Bootstrap 5 with Dark Mode toggle button that switches between dark and light themes.

Awesome Lists containing this project

README

        

Responsive Dark Mode theme built with Bootstrap 5 with Dark Mode toggle button that switches between dark and light themes.

Check out [Bootstrap Dark Mode Documentation](https://mdbootstrap.com/docs/standard/extended/dark-mode/) for detailed instructions & even more examples.

![Bootstrap Dark Mode](https://mdbootstrap.com/img/Marketing/github/dark-mode/basic.jpeg)

## Dark Mode toggle/switch button

To create a dark mode toggle button add dark mode styles to your main scss file. Use the `@include` rule for any customized class. After that create a toggle button for switching those classes within the entire body.

Learn more how to create your own theming systems and advanced configurations in our [theming docs](https://mdbootstrap.com/docs/standard/content-styles/theme/).

```html
Toggle skin
```

```scss
@import '~mdb-ui-kit/src/scss/mdb.pro.scss';

// DARK SKIN
$my-theme-primary: #1266f1;
$my-theme-secondary: #b23cfd;
$my-dark-theme: mdb-dark-theme($my-theme-primary, $my-theme-secondary);

.dark {
@include mdb-theme($my-dark-theme);
}
```

```JavaScript
const skinToggler = document.getElementById('skinToggler');

const toggleSkin = () => {
document.body.classList.toggle('dark');
}

skinToggler.addEventListener('click', toggleSkin);
```

## How to use?

1. Download MDB 5 - free UI KIT

2. Choose your favourite customized component and click on the image

3. Copy & paste the code into your MDB project

[▶️ Subscribe to YouTube channel for web development tutorials & resources](https://www.youtube.com/MDBootstrap?sub_confirmation=1)

___

## More extended Bootstrap documentation