Skip to content

Commit bf3ac3a

Browse files
committed
Use new bg/fg utilities and data-bs-theme
Replace legacy theme classes across examples with new utility classes and theme attributes. Changes include swapping .bg-dark/.navbar-dark/.text-bg-dark/.link-body-emphasis for bg-black, bg-90, fg-white, fg-body, adding data-bs-theme="dark" where appropriate, removing nav-pills, adjusting icon nav links to use flex-column and removing svg mb-1 spacing, and simplifying sidebar nav classes. Updated example files: album, cheatsheet, headers, navbar-static, navbars, and sidebars.
1 parent d836c38 commit bf3ac3a

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Placeholder from "@shortcodes/Placeholder.astro"
2424
</div>
2525
</div>
2626
</div>
27-
<nav class="navbar navbar-dark bg-dark shadow-sm" aria-label="Album navigation">
27+
<nav class="navbar bg-black 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>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const extra_js = [{ src: 'cheatsheet.js' }]
1010
export const body_class = 'bg-body-tertiary'
1111
---
1212

13-
<header class="bd-header bg-dark py-3 d-flex align-items-stretch border-bottom border-dark">
13+
<header class="bd-header bg-black bg-90 py-3 d-flex align-items-stretch border-bottom border-dark">
1414
<div class="container-fluid d-flex align-items-center">
1515
<h1 class="d-flex align-items-center fs-xl fg-white mb-0">
1616
<img src={getVersionedDocsPath('/assets/brand/bootstrap-logo-white.svg')} width="38" height="30" class="me-3" alt="Bootstrap">

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const extra_css = ['headers.css']
3737
<span class="fs-xl">Simple header</span>
3838
</a>
3939

40-
<ul class="nav nav-pills">
40+
<ul class="nav">
4141
<li class="nav-item"><a href="#" class="nav-link active" aria-current="page">Home</a></li>
4242
<li class="nav-item"><a href="#" class="nav-link">Features</a></li>
4343
<li class="nav-item"><a href="#" class="nav-link">Pricing</a></li>
@@ -234,7 +234,7 @@ export const extra_css = ['headers.css']
234234
<div class="b-example-divider"></div>
235235

236236
<header>
237-
<div class="px-3 py-2 text-bg-dark border-bottom">
237+
<div class="px-3 py-2 fg-white bg-black border-bottom" data-bs-theme="dark">
238238
<div class="container">
239239
<div class="d-flex flex-wrap align-items-center justify-content-center lg:justify-content-start">
240240
<a href="/" class="d-flex align-items-center my-2 lg:my-0 lg:me-auto fg-body text-decoration-none">
@@ -243,32 +243,32 @@ export const extra_css = ['headers.css']
243243

244244
<ul class="nav col-12 lg:col-auto my-2 justify-content-center md:my-0 text-small">
245245
<li>
246-
<a href="#" class="nav-link fg-secondary">
247-
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#home"/></svg>
246+
<a href="#" class="nav-link fg-secondary flex-column">
247+
<svg class="bi d-block mx-auto" width="24" height="24" aria-hidden="true"><use href="#home"/></svg>
248248
Home
249249
</a>
250250
</li>
251251
<li>
252-
<a href="#" class="nav-link fg-white">
253-
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#speedometer2"/></svg>
252+
<a href="#" class="nav-link fg-white flex-column">
253+
<svg class="bi d-block mx-auto" 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 fg-white">
259-
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#table"/></svg>
258+
<a href="#" class="nav-link fg-white flex-column">
259+
<svg class="bi d-block mx-auto" 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 fg-white">
265-
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#grid"/></svg>
264+
<a href="#" class="nav-link fg-white flex-column">
265+
<svg class="bi d-block mx-auto" 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 fg-white">
271-
<svg class="bi d-block mx-auto mb-1" width="24" height="24" aria-hidden="true"><use href="#people-circle"/></svg>
270+
<a href="#" class="nav-link fg-white flex-column">
271+
<svg class="bi d-block mx-auto" width="24" height="24" aria-hidden="true"><use href="#people-circle"/></svg>
272272
Customers
273273
</a>
274274
</li>

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

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

8-
<nav class="navbar md:navbar-expand navbar-dark bg-dark mb-4">
8+
<nav class="navbar md:navbar-expand bg-black bg-90 mb-4" data-bs-theme="dark">
99
<div class="container-fluid">
1010
<a class="navbar-brand" href="#">Top 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/navbars/index.astro

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

88
<main>
9-
<nav class="navbar navbar-dark bg-dark" aria-label="First navbar example">
9+
<nav class="navbar bg-black" aria-label="First navbar example" data-bs-theme="dark">
1010
<div class="container-fluid">
1111
<a class="navbar-brand" href="#">Never expand</a>
1212
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample01" aria-controls="navbarsExample01" aria-expanded="false" aria-label="Toggle navigation">
@@ -40,7 +40,7 @@ export const extra_css = ['navbars.css']
4040
</div>
4141
</nav>
4242

43-
<nav class="navbar navbar-expand navbar-dark bg-dark" aria-label="Second navbar example">
43+
<nav class="navbar navbar-expand bg-black" aria-label="Second navbar example" data-bs-theme="dark">
4444
<div class="container-fluid">
4545
<a class="navbar-brand" href="#">Always expand</a>
4646
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample02" aria-controls="navbarsExample02" aria-expanded="false" aria-label="Toggle navigation">
@@ -63,7 +63,7 @@ export const extra_css = ['navbars.css']
6363
</div>
6464
</nav>
6565

66-
<nav class="navbar sm:navbar-expand navbar-dark bg-dark" aria-label="Third navbar example">
66+
<nav class="navbar sm:navbar-expand bg-black" aria-label="Third navbar example" data-bs-theme="dark">
6767
<div class="container-fluid">
6868
<a class="navbar-brand" href="#">Expand at sm</a>
6969
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample03" aria-controls="navbarsExample03" aria-expanded="false" aria-label="Toggle navigation">
@@ -97,7 +97,7 @@ export const extra_css = ['navbars.css']
9797
</div>
9898
</nav>
9999

100-
<nav class="navbar md:navbar-expand navbar-dark bg-dark" aria-label="Fourth navbar example">
100+
<nav class="navbar md:navbar-expand bg-black" aria-label="Fourth navbar example" data-bs-theme="dark">
101101
<div class="container-fluid">
102102
<a class="navbar-brand" href="#">Expand at md</a>
103103
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample04" aria-controls="navbarsExample04" aria-expanded="false" aria-label="Toggle navigation">
@@ -131,7 +131,7 @@ export const extra_css = ['navbars.css']
131131
</div>
132132
</nav>
133133

134-
<nav class="navbar lg:navbar-expand navbar-dark bg-dark" aria-label="Fifth navbar example">
134+
<nav class="navbar lg:navbar-expand bg-black" aria-label="Fifth navbar example" data-bs-theme="dark">
135135
<div class="container-fluid">
136136
<a class="navbar-brand" href="#">Expand at lg</a>
137137
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample05" aria-controls="navbarsExample05" aria-expanded="false" aria-label="Toggle navigation">
@@ -165,7 +165,7 @@ export const extra_css = ['navbars.css']
165165
</div>
166166
</nav>
167167

168-
<nav class="navbar xl:navbar-expand navbar-dark bg-dark" aria-label="Sixth navbar example">
168+
<nav class="navbar xl:navbar-expand bg-black" aria-label="Sixth navbar example" data-bs-theme="dark">
169169
<div class="container-fluid">
170170
<a class="navbar-brand" href="#">Expand at xl</a>
171171
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample06" aria-controls="navbarsExample06" aria-expanded="false" aria-label="Toggle navigation">
@@ -199,7 +199,7 @@ export const extra_css = ['navbars.css']
199199
</div>
200200
</nav>
201201

202-
<nav class="navbar 2xl:navbar-expand navbar-dark bg-dark" aria-label="Seventh navbar example">
202+
<nav class="navbar 2xl:navbar-expand bg-black" aria-label="Seventh navbar example" data-bs-theme="dark">
203203
<div class="container-fluid">
204204
<a class="navbar-brand" href="#">Expand at 2xl</a>
205205
<button class="btn-icon navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarsExample2xl" aria-controls="navbarsExample2xl" aria-expanded="false" aria-label="Toggle navigation">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const extra_js = [{src: 'sidebars.js'}]
127127
</ul>
128128
<hr>
129129
<div>
130-
<a href="#" class="d-flex align-items-center link-body-emphasis text-decoration-none" data-bs-toggle="menu" aria-expanded="false">
130+
<a href="#" class="d-flex align-items-center fg-body text-decoration-none" data-bs-toggle="menu" aria-expanded="false">
131131
<img src="https://github.com/mdo.png" alt="" width="32" height="32" class="rounded-circle me-2">
132132
<strong>mdo</strong>
133133
</a>
@@ -148,7 +148,7 @@ export const extra_js = [{src: 'sidebars.js'}]
148148
<svg class="bi pe-none" width="40" height="32" aria-hidden="true"><use href="#bootstrap"/></svg>
149149
<span class="visually-hidden">Icon-only</span>
150150
</a>
151-
<ul class="nav nav-pills nav-flush flex-column mb-auto text-center">
151+
<ul class="nav nav-flush flex-column mb-auto text-center">
152152
<li class="nav-item">
153153
<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>

0 commit comments

Comments
 (0)