Skip to content

Commit c461bd5

Browse files
committed
Example fixes
Remove data-bs-theme="light" from example dialog elements to rely on global theming and avoid redundant attributes. Adjust heading sizes for better visual hierarchy: reduce "What's new" from fs-3xl to fs-2xl and add fs-xl fw-bold to the "Sign up for free" title. No other functional changes. Refine example themes, accessibility, and layout Unify dark-theme styling and improve accessibility/layout across example pages. Replaced various text-bg-dark/nav classes with bg-black, added fg-white and data-bs-theme="dark" where appropriate, and swapped a header div for a semantic <nav> with an aria-label in the album example. Updated Chart.js to v4.5.1 and changed the dashboard search input type to "search"; adjusted border-right to border-end. Removed an outdated paragraph from the grid example and cleaned up hero/header text classes. Sidebars: made main scrollable with overflow helpers, applied bg-black and fg-white to the sidebar, simplified nav classes, added flex-fill to icon links, and updated sidebars.css to use -webkit-fill-available for height while removing explicit overflow rules. Use fg-* color classes; tweak sidebar alignment Replace instances of text-white/text-secondary with the fg-white/fg-secondary utility across example pages for consistent foreground color utilities. Updated: site/src/assets/examples/{cover,drawer-navbar,features,headers,sidebars}/index.astro. Also added align-items-start to sidebar <ul> elements to improve item alignment.
1 parent ef60fa8 commit c461bd5

12 files changed

Lines changed: 43 additions & 47 deletions

File tree

site/src/assets/examples/album/index.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import Placeholder from "@shortcodes/Placeholder.astro"
66
---
77

88
<header data-bs-theme="dark">
9-
<div class="collapse text-bg-dark" id="navbarHeader">
9+
<div class="collapse bg-black" id="navbarHeader">
1010
<div class="container">
1111
<div class="row">
1212
<div class="sm:col-8 md:col-7 py-4">
13-
<h4>About</h4>
13+
<h4 class="fg-white">About</h4>
1414
<p class="fg-2">Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.</p>
1515
</div>
1616
<div class="sm:col-4 md:offset-1 py-4">
17-
<h4>Contact</h4>
17+
<h4 class="fg-white">Contact</h4>
1818
<ul class="list-unstyled">
1919
<li><a href="#" class="fg-white">Follow on X</a></li>
2020
<li><a href="#" class="fg-white">Like on Facebook</a></li>
@@ -24,7 +24,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
2424
</div>
2525
</div>
2626
</div>
27-
<div class="navbar navbar-dark bg-dark shadow-sm">
27+
<nav class="navbar navbar-dark bg-dark shadow-sm" aria-label="Album navigation">
2828
<div class="container">
2929
<a href="#" class="navbar-brand d-flex align-items-center">
3030
<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>
@@ -34,7 +34,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
3434
<svg class="navbar-toggler-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round"><path d="M1 3.5h14M1 8h14M1 12.5h14"/></svg>
3535
</button>
3636
</div>
37-
</div>
37+
</nav>
3838
</header>
3939

4040
<main>

site/src/assets/examples/cover/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export const body_class = 'd-flex h-100 text-center text-bg-dark'
2626
</main>
2727

2828
<footer class="mt-auto fg-secondary">
29-
<p>Cover template for <a href="https://getbootstrap.com/" class="text-white">Bootstrap</a>, by <a href="https://x.com/mdo" class="text-white">@mdo</a>.</p>
29+
<p>Cover template for <a href="https://getbootstrap.com/" class="fg-white">Bootstrap</a>, by <a href="https://x.com/mdo" class="fg-white">@mdo</a>.</p>
3030
</footer>
3131
</div>

site/src/assets/examples/dashboard/index.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
export const title = 'Dashboard Template'
33
export const extra_css = ['dashboard.css']
44
export const extra_js = [
5-
{ src: 'https://cdn.jsdelivr.net/npm/chart.js@4.3.2/dist/chart.umd.js', integrity: 'sha384-eI7PSr3L1XLISH8JdDII5YN/njoSsxfbrkCTnJrzXt+ENP5MOVBxD+l6sEG4zoLp'},
5+
{ src: 'https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.js', integrity: 'sha256-7MPNHuuMNNIXjj9Z/WPsWj2ENYwRcwrwuZWNyIbXZSo='},
66
{ src: 'dashboard.js'}
77
]
88
---
@@ -74,13 +74,13 @@ export const extra_js = [
7474
</ul>
7575

7676
<div id="navbarSearch" class="navbar-search w-100 collapse">
77-
<input class="form-control w-100 rounded-0 border-0" type="text" placeholder="Search" aria-label="Search">
77+
<input class="form-control w-100 rounded-0 border-0" type="search" placeholder="Search" aria-label="Search">
7878
</div>
7979
</header>
8080

8181
<div class="container-fluid">
8282
<div class="row">
83-
<div class="sidebar border border-right md:col-3 lg:col-2 p-0 bg-body-tertiary">
83+
<div class="sidebar border border-end md:col-3 lg:col-2 p-0 bg-body-tertiary">
8484
<dialog class="md:drawer drawer-end bg-body-tertiary" tabindex="-1" id="sidebarMenu" aria-labelledby="sidebarMenuLabel">
8585
<div class="drawer-header">
8686
<h5 class="drawer-title" id="sidebarMenuLabel">Company name</h5>

site/src/assets/examples/dialogs/index.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const extra_css = ['dialogs.css']
2727

2828
<!-- Modal sheet style -->
2929
<div class="d-flex flex-column p-4 gap-4 md:py-5 align-items-center justify-content-center">
30-
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open data-bs-theme="light">
30+
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open>
3131
<div class="dialog-header border-0">
3232
<h1 class="dialog-title">Modal title</h1>
3333
<button type="button" class="btn-close" aria-label="Close"></button>
@@ -46,7 +46,7 @@ export const extra_css = ['dialogs.css']
4646

4747
<!-- Confirmation dialog -->
4848
<div class="d-flex flex-column p-4 gap-4 md:py-5 align-items-center justify-content-center">
49-
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open data-bs-theme="light">
49+
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open>
5050
<div class="dialog-body text-center py-4">
5151
<h5 class="fw-bold mb-2">Enable this setting?</h5>
5252
<p class="fg-2 mb-0">You can always change your mind in your account settings.</p>
@@ -62,9 +62,9 @@ export const extra_css = ['dialogs.css']
6262

6363
<!-- What's new dialog -->
6464
<div class="d-flex flex-column p-4 gap-4 md:py-5 align-items-center justify-content-center">
65-
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open data-bs-theme="light">
65+
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open>
6666
<div class="dialog-header border-0 pt-4">
67-
<h1 class="dialog-title fs-3xl fw-bold">What's new</h1>
67+
<h1 class="dialog-title fs-2xl fw-bold">What's new</h1>
6868
</div>
6969
<div class="dialog-body">
7070
<ul class="list-unstyled mb-0">
@@ -101,9 +101,9 @@ export const extra_css = ['dialogs.css']
101101

102102
<!-- Sign up dialog -->
103103
<div class="d-flex flex-column p-4 gap-4 md:py-5 align-items-center justify-content-center">
104-
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open data-bs-theme="light">
104+
<dialog class="dialog dialog-example rounded-4 shadow w-340px" open>
105105
<div class="dialog-header border-0">
106-
<h1 class="dialog-title">Sign up for free</h1>
106+
<h1 class="dialog-title fs-xl fw-bold">Sign up for free</h1>
107107
<button type="button" class="btn-close" aria-label="Close"></button>
108108
</div>
109109
<div class="dialog-body pt-0">

site/src/assets/examples/drawer-navbar/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
6565
</div>
6666

6767
<main class="container">
68-
<div class="d-flex align-items-center p-3 my-3 text-white bg-purple rounded shadow-sm">
68+
<div class="d-flex align-items-center p-3 my-3 fg-white bg-purple rounded shadow-sm">
6969
<img class="me-3" src={getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')} alt="" width="48" height="38">
7070
<div class="lh-1">
7171
<h1 class="h6 mb-0 fg-white lh-1">Bootstrap</h1>

site/src/assets/examples/features/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const extra_css = ['features.css']
149149
<div class="row row-cols-1 lg:row-cols-3 align-items-stretch g-4 py-5">
150150
<div class="col">
151151
<div class="card card-cover h-100 overflow-hidden text-bg-dark rounded-4 shadow-lg" style="background-image: url('unsplash-photo-1.jpg');">
152-
<div class="d-flex flex-column h-100 p-5 pb-3 text-white text-shadow-1">
152+
<div class="d-flex flex-column h-100 p-5 pb-3 fg-white text-shadow-1">
153153
<h3 class="pt-5 mt-5 mb-4 display-6 lh-1 fw-bold">Short title, long jacket</h3>
154154
<ul class="d-flex list-unstyled mt-auto">
155155
<li class="me-auto">
@@ -170,7 +170,7 @@ export const extra_css = ['features.css']
170170

171171
<div class="col">
172172
<div class="card card-cover h-100 overflow-hidden text-bg-dark rounded-4 shadow-lg" style="background-image: url('unsplash-photo-2.jpg');">
173-
<div class="d-flex flex-column h-100 p-5 pb-3 text-white text-shadow-1">
173+
<div class="d-flex flex-column h-100 p-5 pb-3 fg-white text-shadow-1">
174174
<h3 class="pt-5 mt-5 mb-4 display-6 lh-1 fw-bold">Much longer title that wraps to multiple lines</h3>
175175
<ul class="d-flex list-unstyled mt-auto">
176176
<li class="me-auto">

site/src/assets/examples/grid/index.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ export const body_class = 'py-4'
172172
<hr class="my-4">
173173

174174
<h2 class="mt-4">Containers</h2>
175-
<p>Additional classes added in Bootstrap v4.4 allow containers that are 100% wide until a particular breakpoint. v5 adds a new <code>2xl</code> breakpoint.</p>
176175
</div>
177176

178177
<div class="container themed-container text-center">.container</div>

site/src/assets/examples/headers/index.astro

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ export const extra_css = ['headers.css']
9191
<header class="p-3 bg-body fg-body" data-bs-theme="dark">
9292
<div class="container">
9393
<div class="d-flex flex-wrap align-items-center justify-content-center lg:justify-content-start">
94-
<a href="/" class="d-flex align-items-center mb-2 lg:mb-0 text-white text-decoration-none">
94+
<a href="/" class="d-flex align-items-center mb-2 lg:mb-0 fg-white text-decoration-none">
9595
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use href="#bootstrap"/></svg>
9696
</a>
9797

9898
<ul class="nav col-12 lg:col-auto lg:me-auto mb-2 justify-content-center md:mb-0">
9999
<li><a href="#" class="nav-link px-2 fg-secondary">Home</a></li>
100-
<li><a href="#" class="nav-link px-2 text-white">Features</a></li>
101-
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
102-
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
103-
<li><a href="#" class="nav-link px-2 text-white">About</a></li>
100+
<li><a href="#" class="nav-link px-2 fg-white">Features</a></li>
101+
<li><a href="#" class="nav-link px-2 fg-white">Pricing</a></li>
102+
<li><a href="#" class="nav-link px-2 fg-white">FAQs</a></li>
103+
<li><a href="#" class="nav-link px-2 fg-white">About</a></li>
104104
</ul>
105105

106106
<form class="col-12 lg:col-auto mb-3 lg:mb-0 lg:me-3" role="search">
@@ -237,7 +237,7 @@ export const extra_css = ['headers.css']
237237
<div class="px-3 py-2 text-bg-dark border-bottom">
238238
<div class="container">
239239
<div class="d-flex flex-wrap align-items-center justify-content-center lg:justify-content-start">
240-
<a href="/" class="d-flex align-items-center my-2 lg:my-0 lg:me-auto text-white text-decoration-none">
240+
<a href="/" class="d-flex align-items-center my-2 lg:my-0 lg:me-auto fg-body text-decoration-none">
241241
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use href="#bootstrap"/></svg>
242242
</a>
243243

@@ -249,25 +249,25 @@ export const extra_css = ['headers.css']
249249
</a>
250250
</li>
251251
<li>
252-
<a href="#" class="nav-link text-white">
252+
<a href="#" class="nav-link fg-white">
253253
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#speedometer2"/></svg>
254254
Dashboard
255255
</a>
256256
</li>
257257
<li>
258-
<a href="#" class="nav-link text-white">
258+
<a href="#" class="nav-link fg-white">
259259
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#table"/></svg>
260260
Orders
261261
</a>
262262
</li>
263263
<li>
264-
<a href="#" class="nav-link text-white">
264+
<a href="#" class="nav-link fg-white">
265265
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#grid"/></svg>
266266
Products
267267
</a>
268268
</li>
269269
<li>
270-
<a href="#" class="nav-link text-white">
270+
<a href="#" class="nav-link fg-white">
271271
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#people-circle"/></svg>
272272
Customers
273273
</a>

site/src/assets/examples/heroes/index.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ export const extra_css = ['heroes.css']
112112

113113
<div class="b-example-divider"></div>
114114

115-
<div class="bg-dark fg-secondary px-4 py-5 text-center">
115+
<div class="bg-black fg-secondary px-4 py-5 text-center" data-bs-theme="dark">
116116
<div class="py-5">
117-
<h1 class="display-5 fw-bold text-white">Dark color hero</h1>
117+
<h1 class="display-5 fw-bold fg-white">Dark color hero</h1>
118118
<div class="lg:col-6 mx-auto">
119-
<p class="fs-lg mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
119+
<p class="mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
120120
<div class="d-grid gap-2 sm:d-flex sm:justify-content-center">
121121
<button type="button" class="btn-outline theme-info btn-lg px-4 sm:me-3">Custom button</button>
122122
<button type="button" class="btn-outline theme-secondary btn-lg px-4">Secondary</button>

site/src/assets/examples/navbar-fixed/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const title = 'Fixed top navbar example'
55
export const extra_css = ['navbar-fixed.css']
66
---
77

8-
<nav class="navbar md:navbar-expand navbar-dark fixed-top bg-dark">
8+
<nav class="navbar md:navbar-expand bg-black fixed-top" data-bs-theme="dark">
99
<div class="container-fluid">
1010
<a class="navbar-brand" href="#">Fixed navbar</a>
1111
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">

0 commit comments

Comments
 (0)