Skip to content

Commit 9e34dab

Browse files
committed
fixes
1 parent bdd1c79 commit 9e34dab

File tree

16 files changed

+66
-27
lines changed

16 files changed

+66
-27
lines changed

js/src/nav-overflow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class NavOverflow extends BaseComponent {
187187
if (typeof value === 'string' && value !== '') {
188188
const cssValue = getComputedStyle(document.documentElement)
189189
.getPropertyValue(`--bs-breakpoint-${value}`)
190-
return parseFloat(cssValue) || 0
190+
return Number.parseFloat(cssValue) || 0
191191
}
192192

193193
return 0

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"watch-css-test": "nodemon --watch scss/ --ext scss,js --exec \"npm run css-test\"",
110110
"watch-js-main": "nodemon --watch js/src/ --ext js --exec \"npm-run-all js-lint js-compile\"",
111111
"watch-js-docs": "nodemon --watch site/src/assets/ --ext js --exec \"npm run js-lint\"",
112+
"astro-clean": "rm -rf site/.astro site/node_modules/.astro",
112113
"astro-dev": "astro dev --root site --port 9001",
113114
"astro-build": "astro build --root site && rm -rf _site && cp -r site/dist _site",
114115
"astro-preview": "astro preview --root site --port 9001",

scss/_utilities.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ $utilities: map.merge(
439439
property: grid-template-columns,
440440
class: grid-cols,
441441
values: (
442+
"1": 1fr,
442443
"2": repeat(2, 1fr),
443444
"3": repeat(3, 1fr),
444445
"4": repeat(4, 1fr),

site/astro.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export default defineConfig({
5858
]
5959
}
6060
},
61+
devToolbar: {
62+
enabled: false
63+
},
6164
site,
6265
vite: {
6366
plugins: [algoliaPlugin(), stackblitzPlugin()]

site/src/assets/application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
import sidebarScroll from './partials/sidebar.js'
1313
import snippets from './partials/snippets.js'
1414
import stickyNav from './partials/sticky.js'
15+
import tocDrawer from './partials/toc.js'
1516

1617
sidebarScroll()
1718
snippets()
1819
stickyNav()
20+
tocDrawer()

site/src/assets/partials/toc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2+
// IT'S ALL JUST JUNK FOR OUR DOCS!
3+
// ++++++++++++++++++++++++++++++++++++++++++
4+
5+
/*
6+
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)
7+
* Copyright 2011-2026 The Bootstrap Authors
8+
* Licensed under the Creative Commons Attribution 3.0 Unported License.
9+
* For details, see https://creativecommons.org/licenses/by/3.0/.
10+
*/
11+
12+
import { Drawer } from '../../../../dist/js/bootstrap.bundle.js'
13+
14+
export default () => {
15+
const tocSidebar = document.querySelector('#bdTocSidebar')
16+
17+
if (!tocSidebar) {
18+
return
19+
}
20+
21+
tocSidebar.addEventListener('click', event => {
22+
if (event.target.closest('.nav-link')) {
23+
Drawer.getInstance('#bdTocSidebar')?.hide()
24+
}
25+
})
26+
}

site/src/components/header/Navigation.astro

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface Props {
2121
2222
const { addedIn, layout, title } = Astro.props
2323
24-
const activeSection = title === 'Examples' ? 'Examples' : 'Docs'
24+
const activeSection = !layout ? 'Home' : title === 'Examples' ? 'Examples' : 'Docs'
2525
---
2626

2727
<header class="navbar lg:navbar-expand bd-navbar border-bottom">
@@ -45,6 +45,10 @@ const activeSection = title === 'Examples' ? 'Examples' : 'Docs'
4545
<svg class="bi bi-sm" aria-hidden="true"><use href="#chevron-expand"></use></svg>
4646
</button>
4747
<div class="menu">
48+
<a class:list={['menu-item', { active: !layout }]} href="/">
49+
Home
50+
{!layout && <svg class="bi ms-auto" aria-hidden="true"><use href="#check2"></use></svg>}
51+
</a>
4852
<a
4953
class:list={['menu-item', { active: layout === 'docs' }]}
5054
href={getVersionedDocsPath('getting-started/install/')}
@@ -61,24 +65,24 @@ const activeSection = title === 'Examples' ? 'Examples' : 'Docs'
6165
</a>
6266
<a class="menu-item" href={getConfig().icons} target="_blank" rel="noopener">
6367
Icons
64-
<svg class="bi ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
68+
<svg class="bi bi-sm ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
6569
</a>
6670
<a class="menu-item" href={getConfig().blog} target="_blank" rel="noopener">
6771
Blog
68-
<svg class="bi ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
72+
<svg class="bi bi-sm ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
6973
</a>
7074
<hr class="menu-divider" />
7175
<a class="menu-item" href={getConfig().github_org} target="_blank" rel="noopener">
7276
GitHub
73-
<svg class="bi ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
77+
<svg class="bi bi-sm ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
7478
</a>
7579
<a class="menu-item" href={getConfig().opencollective} target="_blank" rel="noopener">
7680
OpenCollective
77-
<svg class="bi ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
81+
<svg class="bi bi-sm ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
7882
</a>
7983
<a class="menu-item" href={`https://x.com/${getConfig().x}`} target="_blank" rel="noopener">
8084
Twitter/X
81-
<svg class="bi ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
85+
<svg class="bi bi-sm ms-auto" aria-hidden="true"><use href="#box-arrow-up-right"></use></svg>
8286
</a>
8387
</div>
8488
</div>

site/src/components/shortcodes/ButtonPlayground.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const rounded = ['default', 'pill', 'square']
128128
</div>
129129

130130
<Example
131-
class="d-flex align-items-start gap-2"
131+
class="d-flex flex-wrap align-items-start gap-2"
132132
code={`<button type="button" class="btn-solid theme-primary btn-sm" data-button-type="text">Button</button>
133133
<button type="button" class="btn-solid theme-primary" data-button-type="left-icon">
134134
<svg class="bi me-1" width="16" height="16" aria-hidden="true">

site/src/content/docs/components/button-group.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ Checkbox toggle buttons can be grouped together. Any or all of the buttons can b
5454
<Example code={`<div class="btn-group" role="group" aria-label="Basic checkbox toggle button group">
5555
<label class="btn-check btn-outline theme-primary">
5656
<input type="checkbox" autocomplete="off">
57-
Checkbox 1
57+
Check 1
5858
</label>
5959
<label class="btn-check btn-outline theme-primary">
6060
<input type="checkbox" autocomplete="off">
61-
Checkbox 2
61+
Check 2
6262
</label>
6363
<label class="btn-check btn-outline theme-primary">
6464
<input type="checkbox" autocomplete="off">
65-
Checkbox 3
65+
Check 3
6666
</label>
6767
</div>`} />
6868

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Bootstrap includes several button variants, each serving its own semantic purpos
2525

2626
Compare all button variants and styles at once:
2727

28-
<Example class="bd-example-buttons justify-items-start" code={[...getData('theme-colors').map((themeColor) => `<button type="button" class="btn-solid theme-${themeColor.name}">${themeColor.title}</button>
28+
<Example class="bd-example-buttons md:justify-items-start" code={[...getData('theme-colors').map((themeColor) => `<button type="button" class="btn-solid theme-${themeColor.name}">${themeColor.title}</button>
2929
<button type="button" class="btn-outline theme-${themeColor.name}">${themeColor.title}</button>
3030
<button type="button" class="btn-subtle theme-${themeColor.name}">${themeColor.title}</button>
3131
<button type="button" class="btn-text theme-${themeColor.name}">${themeColor.title}</button>`)]} />
@@ -46,7 +46,7 @@ Link buttons can also be styled with the theme colors.
4646

4747
Add visual depth to solid buttons with gradients and shadows using the `.btn-styled` modifier class. This provides a more three-dimensional appearance that can be customized further with CSS variables.
4848

49-
<Example code={[...getData('theme-colors').map((themeColor) => `<button class="btn-solid btn-styled theme-${themeColor.name}">${themeColor.title}</button>`)]} />
49+
<Example class="d-flex flex-wrap gap-2" code={[...getData('theme-colors').map((themeColor) => `<button class="btn-solid btn-styled theme-${themeColor.name}">${themeColor.title}</button>`)]} />
5050

5151
The gradient and shadow can be customized via CSS variables:
5252

@@ -69,7 +69,7 @@ The `.btn` classes are designed to be used with the `<button>` element. However,
6969

7070
When using button classes on `<a>` elements that are used to trigger in-page functionality (like collapsing content), rather than linking to new pages or sections within the current page, these links should be given a `role="button"` to appropriately convey their purpose to assistive technologies such as screen readers.
7171

72-
<Example code={`<a class="btn-solid theme-primary" href="#" role="button">Link</a>
72+
<Example class="d-flex flex-wrap gap-2" code={`<a class="btn-solid theme-primary" href="#" role="button">Link</a>
7373
<button class="btn-solid theme-primary" type="submit">Button</button>
7474
<input class="btn-solid theme-primary" type="button" value="Input">
7575
<input class="btn-solid theme-primary" type="submit" value="Submit">
@@ -131,7 +131,7 @@ Combine with size classes for different icon button sizes:
131131

132132
Make buttons look inactive by adding the `disabled` boolean attribute to any `<button>` element. Disabled buttons have `pointer-events: none`, preventing hover and active states from triggering, and some additional styling to indicate the disabled state.
133133

134-
<Example code={`<button type="button" class="btn-solid theme-primary" disabled>Primary button</button>
134+
<Example class="d-flex flex-wrap gap-2" code={`<button type="button" class="btn-solid theme-primary" disabled>Primary button</button>
135135
<button type="button" class="btn-solid theme-secondary" disabled>Button</button>
136136
<button type="button" class="btn-outline theme-primary" disabled>Primary button</button>
137137
<button type="button" class="btn-outline theme-secondary" disabled>Button</button>`} />
@@ -190,7 +190,7 @@ Visually, these toggle buttons are identical to our [JavaScript toggle buttons](
190190

191191
Checkboxes can be checked, unchecked, or disabled. Checkbox-based toggle buttons only toggle a single button’s state.
192192

193-
<Example code={`<label class="btn-check btn-solid theme-primary">
193+
<Example class="d-flex flex-wrap gap-2" code={`<label class="btn-check btn-solid theme-primary">
194194
<input type="checkbox" checked autocomplete="off">
195195
Checked
196196
</label>
@@ -209,7 +209,7 @@ Checkboxes can be checked, unchecked, or disabled. Checkbox-based toggle buttons
209209

210210
Radios can be checked, unchecked, or disabled. Use radio-based toggle buttons to toggle states between a set of buttons that include input elements with the same `name` attribute value.
211211

212-
<Example code={`<label class="btn-check btn-solid theme-primary">
212+
<Example class="d-flex flex-wrap gap-2" code={`<label class="btn-check btn-solid theme-primary">
213213
<input type="radio" name="options" autocomplete="off" checked>
214214
Checked
215215
</label>
@@ -241,11 +241,11 @@ Visually, these toggle buttons are identical to our [input toggle buttons](#togg
241241

242242
Add `data-bs-toggle="button"` to toggle a button’s `active` state. If you’re pre-toggling a button, you must manually add the `.active` class **and** `aria-pressed="true"` to ensure that it is conveyed appropriately to assistive technologies.
243243

244-
<Example class="d-inline-flex gap-1" code={`<button type="button" class="btn-solid theme-primary" data-bs-toggle="button">Toggle button</button>
244+
<Example class="d-flex flex-wrap gap-2" code={`<button type="button" class="btn-solid theme-primary" data-bs-toggle="button">Toggle button</button>
245245
<button type="button" class="btn-solid theme-primary active" data-bs-toggle="button" aria-pressed="true">Active toggle button</button>
246246
<button type="button" class="btn-solid theme-primary" disabled data-bs-toggle="button">Disabled toggle button</button>`} />
247247

248-
<Example class="d-inline-flex gap-1" code={`<a href="#" class="btn-solid theme-primary" role="button" data-bs-toggle="button">Toggle link</a>
248+
<Example class="d-flex flex-wrap gap-2" code={`<a href="#" class="btn-solid theme-primary" role="button" data-bs-toggle="button">Toggle link</a>
249249
<a href="#" class="btn-solid theme-primary active" role="button" data-bs-toggle="button" aria-pressed="true">Active toggle link</a>
250250
<a class="btn-solid theme-primary disabled" aria-disabled="true" role="button" data-bs-toggle="button">Disabled toggle link</a>`} />
251251

0 commit comments

Comments
 (0)