notes.dt.in.th

Dark mode in Bootstrap 5.3

Bootstrap 5.3 introduced support for dark mode. This note describes how to use it in a Vite project.

  1. Install Bootstrap 5.3 and Popper.js:

    $ pnpm add bootstrap@5.3.0-alpha1 @popperjs/core
  2. Set data-bs-theme="dark" on the <html> element:

    <html data-bs-theme="dark">