Skip to content

Commit c6919d2

Browse files
mdonextgenthemes
andauthored
v6: More docs updates (#42450)
* Add "new" badge to Stepper It's new. * Remove commented out * Rearrange docs sidebar again to remove components groups, tweak a few things * New default components page * Fix swatch, update some content * Revamp how we're doing themes in docs to be more instant --------- Co-authored-by: nextgenthemes <nextgenthemes@users.noreply.github.com>
1 parent 1b57f4c commit c6919d2

16 files changed

Lines changed: 157 additions & 99 deletions

File tree

site/data/sidebar.yml

Lines changed: 47 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
icon_color: indigo
88
pages:
99
- title: Install
10-
# - title: Introduction
1110
- title: Approach
1211
- title: CSS variables
1312
- title: JavaScript
1413
- title: Accessibility
15-
# - title: Community
1614

1715
- title: Guides
1816
section: Guides
@@ -111,64 +109,54 @@
111109
icon: menu-button-wide-fill
112110
icon_color: cyan
113111
pages:
114-
- group: Buttons
115-
pages:
116-
- title: Buttons
117-
- title: Button group
118-
- title: Close button
119-
- group: Feedback
120-
pages:
121-
- title: Alert
122-
- title: Badge
123-
- title: Placeholder
124-
- title: Progress
125-
- title: Spinner
126-
- group: Overlays
127-
pages:
128-
- title: Menu
129-
meta:
130-
- added: 6.0.0
131-
- title: Dialog
132-
meta:
133-
- added: 6.0.0
134-
- title: Drawer
135-
meta:
136-
- added: 6.0.0
137-
- title: Popover
138-
- title: Toasts
139-
- title: Tooltip
140-
- group: Navigation
141-
pages:
142-
- title: Breadcrumb
143-
- title: Nav
144-
- title: Tab
145-
- title: Nav overflow
146-
meta:
147-
- added: 6.0.0
148-
- title: Navbar
149-
meta:
150-
- added: 6.0.0
151-
- title: Pagination
152-
- title: Stepper
153-
- group: Layout
154-
pages:
155-
- title: Card
156-
- title: List group
157-
- group: Interactions
158-
pages:
159-
- title: Accordion
160-
- title: Carousel
161-
- title: Collapse
162-
- title: Scrollspy
163-
- title: Toggler
164-
meta:
165-
- added: 6.0.0
112+
- title: Accordion
113+
meta:
114+
- added: 6.0.0
115+
- title: Alert
116+
- title: Avatar
117+
meta:
118+
- added: 6.0.0
119+
- title: Badge
120+
- title: Breadcrumb
121+
- title: Button
122+
- title: Button group
123+
- title: Card
124+
- title: Carousel
125+
- title: Close button
126+
- title: Collapse
127+
- title: Dialog
128+
meta:
129+
- added: 6.0.0
130+
- title: Drawer
131+
meta:
132+
- added: 6.0.0
133+
- title: List group
134+
- title: Menu
135+
meta:
136+
- added: 6.0.0
137+
- title: Nav
138+
- title: Nav overflow
139+
meta:
140+
- added: 6.0.0
141+
- title: Navbar
142+
meta:
143+
- added: 6.0.0
166144

167-
- group: Miscellaneous
168-
pages:
169-
- title: Avatar
170-
meta:
171-
- added: 6.0.0
145+
- title: Pagination
146+
- title: Placeholder
147+
- title: Popover
148+
- title: Progress
149+
- title: Scrollspy
150+
- title: Spinner
151+
- title: Stepper
152+
meta:
153+
- added: 6.0.0
154+
- title: Tab
155+
- title: Toasts
156+
- title: Toggler
157+
meta:
158+
- added: 6.0.0
159+
- title: Tooltip
172160

173161
- title: Helpers
174162
section: Helpers

site/src/assets/application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import sidebarScroll from './partials/sidebar.js'
1111
import snippets from './partials/snippets.js'
1212
import stickyNav from './partials/sticky.js'
13+
import theme from './partials/theme.js'
1314
import tocDrawer from './partials/toc.js'
1415

1516
export default () => {
1617
sidebarScroll()
1718
snippets()
1819
stickyNav()
20+
theme()
1921
tocDrawer()
2022
}

site/src/assets/partials/theme.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// NOTICE: Internal docs helpers — not shipped in Bootstrap; not for reuse.
2+
3+
/*
4+
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)
5+
* Copyright 2011-2026 The Bootstrap Authors
6+
* Licensed under the Creative Commons Attribution 3.0 Unported License.
7+
* For details, see https://creativecommons.org/licenses/by/3.0/.
8+
*/
9+
10+
import { Menu } from '@bootstrap'
11+
12+
export default () => {
13+
const themeSwitcher = document.getElementById('bd-theme')
14+
15+
if (!themeSwitcher) {
16+
return
17+
}
18+
19+
document.addEventListener('click', event => {
20+
const toggle = event.target.closest('[data-bs-theme-value]')
21+
22+
if (!toggle) {
23+
return
24+
}
25+
26+
Menu.getOrCreateInstance(themeSwitcher).hide()
27+
}, true)
28+
}

site/src/components/DocsSidebar.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const sidebar = getData('sidebar')
1919
<strong class="bd-links-heading d-flex w-100 align-items-center fw-semibold">
2020
{group.icon && (
2121
<svg
22-
class="bi me-2"
22+
class="bi me-1"
2323
style={
2424
group.icon_color &&
2525
`color: light-dark(var(--bs-${group.icon_color}-500), var(--bs-${group.icon_color}-400));`

site/src/components/shortcodes/Swatch.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ const sizeStyles = {
2323
verticalAlign: 'text-bottom',
2424
width: '1rem',
2525
height: '1rem',
26-
borderRadius: 'var(--bs-border-radius-sm)'
26+
borderRadius: 'var(--bs-radius-3)'
2727
},
2828
medium: {
2929
width: '100%',
3030
paddingBlock: '1.5rem',
31-
borderRadius: 'var(--bs-border-radius)'
31+
borderRadius: 'var(--bs-radius-5)'
3232
},
3333
large: {
3434
width: '100%',
3535
paddingBlock: '.5rem',
3636
paddingInline: '1rem',
37-
borderRadius: 'var(--bs-border-radius-lg)'
37+
borderRadius: 'var(--bs-radius-7)'
3838
}
3939
}
4040

site/src/content/docs/components/accordion.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
title: Accordion
33
description: Build vertically collapsing accordions with native HTML `<details>` and `<summary>` elements.
44
toc: true
5+
aliases:
6+
- "/docs/[[config:docs_version]]/components/"
7+
- "/docs/components/"
8+
- "/components/"
59
css_layer: components
610
---
711

site/src/content/docs/components/buttons.mdx renamed to site/src/content/docs/components/button.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
---
2-
title: Buttons
2+
title: Button
33
description: Use Bootstrap’s custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.
44
aliases:
5-
- "/docs/[[config:docs_version]]/components/"
6-
- "/docs/components/"
7-
- "/components/"
5+
- "/docs/[[config:docs_version]]/components/buttons/"
86
toc: true
97
css_layer: components
108
---

site/src/content/docs/customize/color-modes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Color modes
3-
description: Bootstrap now supports color modes, or themes, as of v5.3.0. Explore our default light color mode and the new dark mode, or create your own using our styles as your template.
3+
description: Bootstrap supports light and dark color modes. Dark mode is available globally by default, but can also be applied to specific components and elements via `data-bs-theme` attribute.
44
toc: true
55
---
66

site/src/content/docs/customize/theme.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Theme
3-
description: The Bootstrap theme is a set of semantically named colors that are used to style our components, utilities, and more. The theme is configurable, responds to color modes, and can be consumed via Sass or CSS.
3+
description: The Bootstrap theme is a set of semantically named tokens that are used to style our components, utilities, and more. The theme is configurable, responds to color modes, and can be consumed via Sass or CSS.
44
toc: true
55
---
66

site/src/content/docs/guides/quickstart.mdx

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: CDN Quickstart
33
description: The official guide for how to include Bootstrap’s CSS and JavaScript in your project using a CDN.
4+
toc: true
45
aliases:
56
- "/docs/[[config:docs_version]]/guides/"
67
- "/docs/guides/"
@@ -9,9 +10,11 @@ aliases:
910

1011
Get started using Bootstrap in seconds by including our production-ready CSS and JavaScript by [using a CDN]([[docsref:/getting-started/install#cdn]]) without the need for any build steps. CDNs provide copies of Bootstrap’s codebase that’s ready to be used in any environment with minimal code changes required on your part.
1112

12-
<Callout type="info">
13-
**Got the gist already?** See the end result in this [Bootstrap CodePen demo](https://codepen.io/team/bootstrap/pen/qBamdLj).
14-
</Callout>
13+
## Live demo
14+
15+
**Already familiar with setting up HTML pages?** See the end result in this [Bootstrap CodePen demo](https://codepen.io/team/bootstrap/pen/qBamdLj).
16+
17+
## Steps
1518

1619
1. **Create a new `index.html` file in your project root.** Include the `<meta name="viewport">` tag as well for [proper responsive behavior](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport) in mobile devices.
1720

@@ -62,3 +65,43 @@ Get started using Bootstrap in seconds by including our production-ready CSS and
6265
```
6366

6467
3. **Hello, world!** Open the page in your browser of choice to see your Bootstrapped page. Now you can start building with Bootstrap by creating your own [layout]([[docsref:/layout/grid]]), adding dozens of [components]([[docsref:/components/buttons]]), and utilizing [our official examples]([[docsref:/examples]]).
68+
69+
## Optional font
70+
71+
Bootstrap's source code defaults to a [native font stack]([[docsref:/content/reboot#native-font-stack]]), but we use a custom font for our hosted documentation to for more consistent styling across platforms. We use [Geist](https://fonts.google.com/specimen/Geist) and Geist Mono, and recommend using the same or similar in your project.
72+
73+
1. **Add the Geist web font from Google Fonts.** Add the following to your `<head>`, before Bootstrap’s CSS:
74+
75+
```html
76+
<!doctype html>
77+
<html lang="en">
78+
<head>
79+
<meta charset="utf-8">
80+
<meta name="viewport" content="width=device-width, initial-scale=1">
81+
<title>Bootstrap demo</title>
82+
<link rel="preconnect" href="https://fonts.googleapis.com"><!--[!code highlight]-->
83+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><!--[!code highlight]-->
84+
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap" rel="stylesheet"><!--[!code highlight]-->
85+
<link href="[[config:cdn.css]]" rel="stylesheet" integrity="[[config:cdn.css_hash]]" crossorigin="anonymous">
86+
</head>
87+
<body>
88+
<h1>Hello, world!</h1>
89+
<script type="module" src="[[config:cdn.js_bundle]]" integrity="[[config:cdn.js_bundle_hash]]" crossorigin="anonymous"></script>
90+
</body>
91+
</html>
92+
```
93+
94+
2. **Apply the fonts by overriding Bootstrap’s CSS variables.** You can do this in a `<style>` tag in your `<head>` or in a custom CSS file.
95+
96+
```html
97+
<style>
98+
:root {
99+
--bs-body-font-family: "Geist", system-ui, sans-serif;
100+
--bs-font-mono: "Geist Mono", ui-monospace, monospace;
101+
}
102+
</style>
103+
```
104+
105+
You can also do the same in your custom Sass file should you graduate from a CDN setup to one that includes Bootstrap via a package manager.
106+
107+
Learn more about Bootstrap’s typography defaults in [Typography]([[docsref:/content/typography]]) and [Reboot]([[docsref:/content/reboot#native-font-stack]]).

0 commit comments

Comments
 (0)