Skip to content

Commit 763b0af

Browse files
committed
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.
1 parent ef60fa8 commit 763b0af

8 files changed

Lines changed: 21 additions & 25 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/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/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ 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

@@ -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

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">

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ export const extra_js = [{src: 'sidebars.js'}]
2828
</symbol>
2929
</svg>
3030

31-
<main class="d-flex flex-nowrap">
31+
<main class="d-flex flex-nowrap overflow-x-auto overflow-y-hidden max-h-100 vh-100">
3232
<h1 class="visually-hidden">Sidebars examples</h1>
3333

34-
<div class="d-flex flex-column flex-shrink-0 p-3 text-bg-dark" style="width: 280px;">
35-
<a href="/" class="d-flex align-items-center mb-3 md:mb-0 md:me-auto text-white text-decoration-none">
34+
<div class="d-flex flex-column flex-shrink-0 p-3 bg-black" style="width: 280px;" data-bs-theme="dark">
35+
<a href="/" class="d-flex align-items-center mb-3 md:mb-0 md:me-auto fg-white text-decoration-none">
3636
<svg class="bi pe-none me-2" width="40" height="32" aria-hidden="true"><use href="#bootstrap"/></svg>
3737
<span class="fs-xl">Sidebar</span>
3838
</a>
3939
<hr>
40-
<ul class="nav nav-pills flex-column mb-auto">
40+
<ul class="nav flex-column mb-auto">
4141
<li class="nav-item">
4242
<a href="#" class="nav-link active" aria-current="page">
4343
<svg class="bi pe-none me-2" width="16" height="16" aria-hidden="true"><use href="#home"/></svg>
@@ -71,7 +71,7 @@ export const extra_js = [{src: 'sidebars.js'}]
7171
</ul>
7272
<hr>
7373
<div>
74-
<a href="#" class="d-flex align-items-center text-white text-decoration-none" data-bs-toggle="menu" aria-expanded="false">
74+
<a href="#" class="d-flex align-items-center fg-white text-decoration-none" data-bs-toggle="menu" aria-expanded="false">
7575
<img src="https://github.com/mdo.png" alt="" width="32" height="32" class="rounded-circle me-2">
7676
<strong>mdo</strong>
7777
</a>
@@ -93,7 +93,7 @@ export const extra_js = [{src: 'sidebars.js'}]
9393
<span class="fs-xl">Sidebar</span>
9494
</a>
9595
<hr>
96-
<ul class="nav nav-pills flex-column mb-auto">
96+
<ul class="nav flex-column mb-auto">
9797
<li class="nav-item">
9898
<a href="#" class="nav-link active" aria-current="page">
9999
<svg class="bi pe-none me-2" width="16" height="16" aria-hidden="true"><use href="#home"/></svg>
@@ -150,7 +150,7 @@ export const extra_js = [{src: 'sidebars.js'}]
150150
</a>
151151
<ul class="nav nav-pills nav-flush flex-column mb-auto text-center">
152152
<li class="nav-item">
153-
<a href="#" class="nav-link active py-3 border-bottom rounded-0" aria-current="page" title="Home" data-bs-toggle="tooltip" data-bs-placement="right">
153+
<a href="#" class="nav-link active py-3 border-bottom rounded-0 flex-fill" aria-current="page" title="Home" data-bs-toggle="tooltip" data-bs-placement="right">
154154
<svg class="bi pe-none" width="24" height="24" role="img" aria-label="Home"><use href="#home"/></svg>
155155
</a>
156156
</li>

site/src/assets/examples/sidebars/sidebars.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ html {
88
}
99

1010
main {
11-
height: 100vh;
1211
height: -webkit-fill-available;
1312
max-height: 100vh;
14-
overflow-x: auto;
15-
overflow-y: hidden;
1613
}
1714

1815
.menu-toggle { outline: 0; }

0 commit comments

Comments
 (0)