v5: examples: Replace deprecated classes#42423
Open
coliff wants to merge 1 commit into
Open
Conversation
Replace legacy 'navbar-dark' classes with the newer data-bs-theme='dark' attribute across example pages and adjust related dark-mode styling. Other updates: remove redundant 'btn-close-white', change 'text-muted' to 'text-body-secondary', replace 'border-right' with 'border-end' for logical edge utilities, and apply data-bs-theme to offcanvas/dropdown elements where appropriate. These changes standardize dark theme handling and update utilities in multiple site examples.
There was a problem hiding this comment.
Pull request overview
This PR updates multiple Bootstrap site examples to use the newer data-bs-theme="dark" approach instead of legacy *-dark variant classes, and modernizes a handful of deprecated/legacy utility classes to their current equivalents.
Changes:
- Replaced
navbar-darkusages withdata-bs-theme="dark"across example navbars/offcanvas. - Updated deprecated utility classes (e.g.,
text-muted→text-body-secondary,border-right→border-end). - Removed redundant
btn-close-whitewhere dark theme scoping is applied.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| site/src/assets/examples/sticky-footer-navbar/index.astro | Migrates fixed navbar to data-bs-theme="dark". |
| site/src/assets/examples/sidebars/index.astro | Updates dark dropdown menu theming approach. |
| site/src/assets/examples/product/index.astro | Replaces deprecated muted text utility. |
| site/src/assets/examples/offcanvas-navbar/index.astro | Migrates navbar-dark to data-bs-theme="dark". |
| site/src/assets/examples/navbars/index.astro | Migrates multiple navbar variants to data-bs-theme="dark". |
| site/src/assets/examples/navbars-offcanvas/index.astro | Applies data-bs-theme="dark" for navbars/offcanvas and simplifies close button classing. |
| site/src/assets/examples/navbar-static/index.astro | Migrates navbar-dark to data-bs-theme="dark". |
| site/src/assets/examples/navbar-fixed/index.astro | Migrates navbar-dark to data-bs-theme="dark". |
| site/src/assets/examples/navbar-bottom/index.astro | Migrates navbar-dark to data-bs-theme="dark". |
| site/src/assets/examples/jumbotrons/index.astro | Replaces deprecated muted text utility usages. |
| site/src/assets/examples/dashboard/index.astro | Updates legacy border utility to logical border-end. |
| site/src/assets/examples/dashboard-rtl/index.astro | Updates legacy border utility to logical border-end in RTL example. |
| site/src/assets/examples/cheatsheet/index.astro | Migrates example navbar to data-bs-theme="dark". |
| site/src/assets/examples/cheatsheet-rtl/index.astro | Migrates example navbar to data-bs-theme="dark" in RTL variant. |
| site/src/assets/examples/carousel/index.astro | Removes navbar-dark from the carousel example navbar. |
| site/src/assets/examples/carousel-rtl/index.astro | Removes navbar-dark from the carousel RTL example navbar. |
| site/src/assets/examples/album/index.astro | Removes navbar-dark from the album header navbar. |
| site/src/assets/examples/album-rtl/index.astro | Removes navbar-dark from the album RTL header navbar. |
Comments suppressed due to low confidence (2)
site/src/assets/examples/album/index.astro:34
- This
.navbarlost the.navbar-darkclass but wasn’t givendata-bs-theme="dark". Bootstrap’s dark navbar variables are only applied for.navbar-darkor.navbar[data-bs-theme="dark"](seescss/_navbar.scss), so this header bar will use light navbar text/toggler styling onbg-dark. Adddata-bs-theme="dark"on this.navbarelement (or restore.navbar-dark).
</div>
<div class="navbar bg-dark shadow-sm">
<div class="container">
<a href="#" class="navbar-brand d-flex align-items-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="me-2" viewBox="0 0 24 24"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
<strong>Album</strong>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
site/src/assets/examples/album-rtl/index.astro:35
- This
.navbarlost the.navbar-darkclass but wasn’t givendata-bs-theme="dark". Since the dark navbar CSS variables are only applied for.navbar-darkor.navbar[data-bs-theme="dark"](seescss/_navbar.scss), this bar will fall back to light navbar colors onbg-dark. Adddata-bs-theme="dark"on this.navbarelement (or restore.navbar-dark).
</div>
<div class="navbar bg-dark shadow-sm">
<div class="container">
<a href="#" class="navbar-brand d-flex align-items-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="me-2" viewBox="0 0 24 24"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
<strong>الألبوم</strong>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="تبديل التنقل">
<span class="navbar-toggler-icon"></span>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace legacy 'navbar-dark' classes with the newer data-bs-theme='dark' attribute across example pages and adjust related dark-mode styling.
Other updates: remove redundant 'btn-close-white', change deprecated 'text-muted' to 'text-body-secondary', replace 'border-right' with 'border-end' for logical edge utilities, and apply
data-bs-themeto offcanvas/dropdown elements where appropriate.Motivation & Context
These changes standardize dark theme handling and update utilities in multiple site examples.
Type of changes
Checklist
npm run lint)Live previews
Related issues