How does dark mode work in Bootstrap 5.3?

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

The attribute can be on the html element for the full page, or on one component (for example a navbar or a card). In your own CSS use variables like var(--bs-body-bg), and prefer .bg-body-tertiary to .bg-light. A theme switcher only changes the attribute with JavaScript. See Color Modes.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.