From 2a51370e92b7651bd8fb243b0a758cada47b43a9 Mon Sep 17 00:00:00 2001 From: Christopher Boik <45264553+MysticZA@users.noreply.github.com> Date: Tue, 30 Nov 2021 16:41:08 +0200 Subject: Fix variable name in customizing comment (#35414) Correct table lightening variable to match the variable name defined and described in the loop variable section above --- site/content/docs/5.1/content/tables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.1/content/tables.md b/site/content/docs/5.1/content/tables.md index c1f6293b4..645145ba4 100644 --- a/site/content/docs/5.1/content/tables.md +++ b/site/content/docs/5.1/content/tables.md @@ -786,4 +786,4 @@ Use `.table-responsive{-sm|-md|-lg|-xl|-xxl}` as needed to create responsive tab ### Customizing - The factor variables (`$table-striped-bg-factor`, `$table-active-bg-factor` & `$table-hover-bg-factor`) are used to determine the contrast in table variants. -- Apart from the light & dark table variants, theme colors are lightened by the `$table-bg-level` variable. +- Apart from the light & dark table variants, theme colors are lightened by the `$table-bg-scale` variable. -- cgit v1.2.3 From 2fe90d8b1652df283c291f1ab71906e1d8bd105c Mon Sep 17 00:00:00 2001 From: Ethan Clevenger Date: Wed, 1 Dec 2021 04:34:03 -0800 Subject: Update edge-to-edge design instructions (#35446) Add note about margins to prevent overflow. --- site/content/docs/5.1/layout/gutters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.1/layout/gutters.md b/site/content/docs/5.1/layout/gutters.md index 87d2731a4..9ea13e4ab 100644 --- a/site/content/docs/5.1/layout/gutters.md +++ b/site/content/docs/5.1/layout/gutters.md @@ -137,7 +137,7 @@ Gutter classes can also be added to [row columns]({{< docsref "/layout/grid#row- The gutters between columns in our predefined grid classes can be removed with `.g-0`. This removes the negative `margin`s from `.row` and the horizontal `padding` from all immediate children columns. -**Need an edge-to-edge design?** Drop the parent `.container` or `.container-fluid`. +**Need an edge-to-edge design?** Drop the parent `.container` or `.container-fluid` and add `.mx-0` to the `.row` to prevent overflow. In practice, here's how it looks. Note you can continue to use this with all other predefined grid classes (including column widths, responsive tiers, reorders, and more). -- cgit v1.2.3 From a5945369bdcaccb5d80589b9e9b0fab67e8a4e9c Mon Sep 17 00:00:00 2001 From: GeoSot Date: Wed, 24 Nov 2021 02:07:17 +0200 Subject: Dropdown: change doc for `data-bs-popper=none` --- site/content/docs/5.1/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.1/migration.md b/site/content/docs/5.1/migration.md index 522e8551b..4ee9c6014 100644 --- a/site/content/docs/5.1/migration.md +++ b/site/content/docs/5.1/migration.md @@ -297,7 +297,7 @@ Your custom Bootstrap CSS builds should now look something like this with a sepa - Breaking All the events for the dropdown are now triggered on the dropdown toggle button and then bubbled up to the parent element. -- Dropdown menus now have a `data-bs-popper="static"` attribute set when the positioning of the dropdown is static and `data-bs-popper="none"` when dropdown is in the navbar. This is added by our JavaScript and helps us use custom position styles without interfering with Popper's positioning. +- Dropdown menus now have a `data-bs-popper="static"` attribute set when the positioning of the dropdown is static, or dropdown is in the navbar. This is added by our JavaScript and helps us use custom position styles without interfering with Popper's positioning. - Breaking Dropped `flip` option for dropdown plugin in favor of native Popper configuration. You can now disable the flipping behavior by passing an empty array for [`fallbackPlacements`](https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements) option in [flip](https://popper.js.org/docs/v2/modifiers/flip/) modifier. -- cgit v1.2.3 From a780d74b28add417be398c525d2ed75775e02e16 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 3 Dec 2021 00:08:01 -0800 Subject: Docs offcanvas navbar (#34487) * Redesign docs navbar to use offcanvas, tweak overall padding while I'm here * Match code snippets to new gutter width * Replace value with docs-specific variable Opted not to do a CSS variable here since on .bd-content it would be inherited into our examples Co-authored-by: XhmikosR --- site/assets/scss/_component-examples.scss | 8 +-- site/assets/scss/_layout.scss | 3 + site/assets/scss/_navbar.scss | 12 ++++ site/assets/scss/_sidebar.scss | 2 +- site/assets/scss/_subnav.scss | 11 +-- site/assets/scss/_variables.scss | 2 + site/layouts/partials/docs-navbar.html | 110 ++++++++++++++++-------------- 7 files changed, 89 insertions(+), 59 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index f93f1ee98..208654ae0 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -85,7 +85,7 @@ .bd-example { position: relative; padding: 1rem; - margin: 1rem (-$grid-gutter-width * .5) 0; + margin: 1rem ($bd-gutter-x * -1) 0; border: solid $gray-300; border-width: 1px 0 0; @include clearfix(); @@ -313,7 +313,7 @@ // .highlight { - padding: 1rem; + padding: var(--bs-gutter-x) $bd-gutter-x; margin-bottom: 1rem; background-color: $gray-100; @@ -338,8 +338,8 @@ } .bd-content .highlight { - margin-right: (-$grid-gutter-width * .5); - margin-left: (-$grid-gutter-width * .5); + margin-right: $bd-gutter-x * -1; + margin-left: $bd-gutter-x * -1; @include media-breakpoint-up(sm) { margin-right: 0; diff --git a/site/assets/scss/_layout.scss b/site/assets/scss/_layout.scss index 707c4949d..03eab6f28 100644 --- a/site/assets/scss/_layout.scss +++ b/site/assets/scss/_layout.scss @@ -1,4 +1,7 @@ .bd-layout { + padding-right: $bd-gutter-x; + padding-left: $bd-gutter-x; + @include media-breakpoint-up(md) { display: grid; gap: $grid-gutter-width; diff --git a/site/assets/scss/_navbar.scss b/site/assets/scss/_navbar.scss index 053cadf2e..07851b55c 100644 --- a/site/assets/scss/_navbar.scss +++ b/site/assets/scss/_navbar.scss @@ -1,4 +1,7 @@ .bd-navbar { + --bs-gutter-x: $bd-gutter-x; + --bs-gutter-y: $bd-gutter-x; + padding: .75rem 0; background-color: $bd-purple-bright; @@ -29,4 +32,13 @@ width: 1rem; height: 1rem; } + + .offcanvas { + background-color: $bd-purple-bright; + border-left: 0; + + @include media-breakpoint-down(md) { + box-shadow: $box-shadow-lg; + } + } } diff --git a/site/assets/scss/_sidebar.scss b/site/assets/scss/_sidebar.scss index d893ba9dc..b6d347fe7 100644 --- a/site/assets/scss/_sidebar.scss +++ b/site/assets/scss/_sidebar.scss @@ -1,6 +1,6 @@ .bd-sidebar { @include media-breakpoint-down(md) { - margin: 0 -.75rem 1rem; + margin: 0 ($bd-gutter-x * -1) 1rem; } } diff --git a/site/assets/scss/_subnav.scss b/site/assets/scss/_subnav.scss index 8377ff423..cc47c6fb5 100644 --- a/site/assets/scss/_subnav.scss +++ b/site/assets/scss/_subnav.scss @@ -1,4 +1,7 @@ .bd-subnavbar { + --bs-gutter-x: $bd-gutter-x; + --bs-gutter-y: $bd-gutter-x; + // The position and z-index are needed for the dropdown to stay on top of the content position: relative; z-index: $zindex-sticky; @@ -31,16 +34,16 @@ position: absolute; top: .4rem; right: .4rem; + bottom: .4rem; display: flex; align-items: center; justify-content: center; - height: 1.5rem; - padding-right: .25rem; - padding-left: .25rem; + padding-right: .3125rem; + padding-left: .3125rem; @include font-size(.75rem); color: $gray-600; content: "Ctrl + /"; - border: $border-width solid $border-color; + background-color: $gray-100; @include border-radius(.125rem); } diff --git a/site/assets/scss/_variables.scss b/site/assets/scss/_variables.scss index 110600260..939492f70 100644 --- a/site/assets/scss/_variables.scss +++ b/site/assets/scss/_variables.scss @@ -11,3 +11,5 @@ $bd-warning: #f0ad4e; $bd-danger: #d9534f; $dropdown-active-icon: url("data:image/svg+xml,"); $sidebar-collapse-icon: url("data:image/svg+xml,"); + +$bd-gutter-x: 1.25rem; diff --git a/site/layouts/partials/docs-navbar.html b/site/layouts/partials/docs-navbar.html index e120c9c74..6611596e6 100644 --- a/site/layouts/partials/docs-navbar.html +++ b/site/layouts/partials/docs-navbar.html @@ -4,62 +4,72 @@ {{ partial "icons/bootstrap-white-fill.svg" (dict "class" "d-block my-1" "width" "40" "height" "32") }} - - \ No newline at end of file + -- cgit v1.2.3 From 2a7015e630e575ed39508c7aa51e8a085922e9e9 Mon Sep 17 00:00:00 2001 From: Alexander Gitter Date: Tue, 7 Dec 2021 19:51:50 +0100 Subject: Fix variable name in form overview docs (#35468) These variables are called $input-btn-*, the documentation was erroneously talking about $btn-input-*. Co-authored-by: XhmikosR --- site/content/docs/5.1/forms/overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.1/forms/overview.md b/site/content/docs/5.1/forms/overview.md index c60cf1ccc..29bead1a3 100644 --- a/site/content/docs/5.1/forms/overview.md +++ b/site/content/docs/5.1/forms/overview.md @@ -145,10 +145,10 @@ While using visually hidden content (`.visually-hidden`, `aria-label`, and even ## Sass -Many form variables are set at a general level to be re-used and extended by individual form components. You'll see these most often as `$btn-input-*` and `$input-*` variables. +Many form variables are set at a general level to be re-used and extended by individual form components. You'll see these most often as `$input-btn-*` and `$input-*` variables. ### Variables -`$btn-input-*` variables are shared global variables between our [buttons]({{< docsref "/components/buttons" >}}) and our form components. You'll find these frequently reassigned as values to other component-specific variables. +`$input-btn-*` variables are shared global variables between our [buttons]({{< docsref "/components/buttons" >}}) and our form components. You'll find these frequently reassigned as values to other component-specific variables. {{< scss-docs name="input-btn-variables" file="scss/_variables.scss" >}} -- cgit v1.2.3 From 8cdb6c40bdf55229459f479111e6a44d49052cf1 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 14 Dec 2021 09:51:31 +0200 Subject: Update stylelint and stylelint-config-twbs-bootstrap (#35438) --- site/assets/scss/_algolia.scss | 3 ++- site/assets/scss/_layout.scss | 6 +++--- site/assets/scss/_placeholder-img.scss | 2 +- site/assets/scss/_syntax.scss | 2 +- site/content/docs/5.1/examples/.stylelintrc | 4 ++-- site/content/docs/5.1/examples/cheatsheet/cheatsheet.css | 8 ++++---- site/content/docs/5.1/examples/cheatsheet/cheatsheet.rtl.css | 8 ++++---- site/content/docs/5.1/examples/features/features.css | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_algolia.scss b/site/assets/scss/_algolia.scss index 097dbdd55..89468d42b 100644 --- a/site/assets/scss/_algolia.scss +++ b/site/assets/scss/_algolia.scss @@ -1,5 +1,7 @@ // Docsearch theming +// stylelint-disable selector-class-pattern + .algolia-autocomplete { width: 100%; } @@ -24,7 +26,6 @@ font-weight: 600; color: $bd-purple-bright; - // stylelint-disable-next-line selector-class-pattern :not(.algolia-docsearch-suggestion__main) > & { display: none; } diff --git a/site/assets/scss/_layout.scss b/site/assets/scss/_layout.scss index 03eab6f28..f83cf094c 100644 --- a/site/assets/scss/_layout.scss +++ b/site/assets/scss/_layout.scss @@ -4,9 +4,9 @@ @include media-breakpoint-up(md) { display: grid; - gap: $grid-gutter-width; grid-template-areas: "sidebar main"; grid-template-columns: 1fr 3fr; + gap: $grid-gutter-width; } @include media-breakpoint-up(lg) { @@ -23,20 +23,20 @@ @include media-breakpoint-up(md) { display: grid; - gap: inherit; grid-template-areas: "intro" "toc" "content"; grid-template-rows: auto auto 1fr; + gap: inherit; } @include media-breakpoint-up(lg) { grid-template-areas: "intro toc" "content toc"; - grid-template-columns: 4fr 1fr; grid-template-rows: auto 1fr; + grid-template-columns: 4fr 1fr; } } diff --git a/site/assets/scss/_placeholder-img.scss b/site/assets/scss/_placeholder-img.scss index 90a29544e..6f5bbe418 100644 --- a/site/assets/scss/_placeholder-img.scss +++ b/site/assets/scss/_placeholder-img.scss @@ -6,8 +6,8 @@ .bd-placeholder-img { @include font-size(1.125rem); - text-anchor: middle; user-select: none; + text-anchor: middle; } .bd-placeholder-img-lg { diff --git a/site/assets/scss/_syntax.scss b/site/assets/scss/_syntax.scss index 8120bbef2..89c81d134 100644 --- a/site/assets/scss/_syntax.scss +++ b/site/assets/scss/_syntax.scss @@ -1,4 +1,4 @@ -// stylelint-disable comment-empty-line-before, declaration-block-single-line-max-declarations, selector-class-pattern +// stylelint-disable comment-empty-line-before, declaration-block-single-line-max-declarations /* Background .chroma { background-color: #f0f0f0; } */ /* Other .chroma .x { } */ diff --git a/site/content/docs/5.1/examples/.stylelintrc b/site/content/docs/5.1/examples/.stylelintrc index dc76dedbd..79ea92df0 100644 --- a/site/content/docs/5.1/examples/.stylelintrc +++ b/site/content/docs/5.1/examples/.stylelintrc @@ -1,12 +1,12 @@ { "extends": [ - "stylelint-config-twbs-bootstrap/css" + "stylelint-config-twbs-bootstrap" ], "rules": { "at-rule-no-vendor-prefix": null, "comment-empty-line-before": null, "media-feature-name-no-vendor-prefix": null, - "property-blacklist": null, + "property-disallowed-list": null, "property-no-vendor-prefix": null, "selector-no-qualifying-type": null, "selector-no-vendor-prefix": null, diff --git a/site/content/docs/5.1/examples/cheatsheet/cheatsheet.css b/site/content/docs/5.1/examples/cheatsheet/cheatsheet.css index 77aa0f23c..ac0342b37 100644 --- a/site/content/docs/5.1/examples/cheatsheet/cheatsheet.css +++ b/site/content/docs/5.1/examples/cheatsheet/cheatsheet.css @@ -99,9 +99,9 @@ body { @media (min-width: 1200px) { body { display: grid; - gap: 1rem; - grid-template-columns: 1fr 4fr 1fr; grid-template-rows: auto; + grid-template-columns: 1fr 4fr 1fr; + gap: 1rem; } .bd-header { @@ -127,10 +127,10 @@ body { .bd-cheatsheet section, .bd-cheatsheet article { display: inherit; /* 1 */ - gap: inherit; /* 1 */ + grid-template-rows: auto; grid-template-columns: 1fr 4fr; grid-column: 1 / span 2; - grid-template-rows: auto; + gap: inherit; /* 1 */ } .bd-aside { diff --git a/site/content/docs/5.1/examples/cheatsheet/cheatsheet.rtl.css b/site/content/docs/5.1/examples/cheatsheet/cheatsheet.rtl.css index c1a4a1ccc..a68c02559 100644 --- a/site/content/docs/5.1/examples/cheatsheet/cheatsheet.rtl.css +++ b/site/content/docs/5.1/examples/cheatsheet/cheatsheet.rtl.css @@ -96,9 +96,9 @@ body { @media (min-width: 1200px) { body { display: grid; - gap: 1rem; - grid-template-columns: 1fr 4fr 1fr; grid-template-rows: auto; + grid-template-columns: 1fr 4fr 1fr; + gap: 1rem; } .bd-header { @@ -122,10 +122,10 @@ body { .bd-cheatsheet section, .bd-cheatsheet article { display: inherit; /* 1 */ - gap: inherit; /* 1 */ + grid-template-rows: auto; grid-template-columns: 1fr 4fr; grid-column: 1 / span 2; - grid-template-rows: auto; + gap: inherit; /* 1 */ } .bd-aside { diff --git a/site/content/docs/5.1/examples/features/features.css b/site/content/docs/5.1/examples/features/features.css index 33942f7f1..cf66e7e20 100644 --- a/site/content/docs/5.1/examples/features/features.css +++ b/site/content/docs/5.1/examples/features/features.css @@ -30,8 +30,8 @@ .icon-link > .bi { margin-top: .125rem; margin-left: .125rem; - transition: transform .25s ease-in-out; fill: currentColor; + transition: transform .25s ease-in-out; } .icon-link:hover > .bi { transform: translate(.25rem); -- cgit v1.2.3 From 28f7c94475b9456897ef9a4b60bc0f45d4db3388 Mon Sep 17 00:00:00 2001 From: Ty Mick Date: Tue, 14 Dec 2021 12:29:35 -0800 Subject: docs: Add responsive variations for align-content-between (#35532) Co-authored-by: XhmikosR --- site/content/docs/5.1/utilities/flex.md | 1 + 1 file changed, 1 insertion(+) (limited to 'site') diff --git a/site/content/docs/5.1/utilities/flex.md b/site/content/docs/5.1/utilities/flex.md index bbb1824b4..b9d359ab1 100644 --- a/site/content/docs/5.1/utilities/flex.md +++ b/site/content/docs/5.1/utilities/flex.md @@ -622,6 +622,7 @@ Responsive variations also exist for `align-content`. - `.align-content{{ .abbr }}-start` - `.align-content{{ .abbr }}-end` - `.align-content{{ .abbr }}-center` +- `.align-content{{ .abbr }}-between` - `.align-content{{ .abbr }}-around` - `.align-content{{ .abbr }}-stretch` {{- end -}} -- cgit v1.2.3 From 2d07383e32b7ad9ebad43e85ebdeb891dd0d105c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Thu, 16 Dec 2021 09:20:48 +0100 Subject: docs: Use param to set Bootstrap version in Contents page (#35556) --- site/content/docs/5.1/getting-started/contents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.1/getting-started/contents.md b/site/content/docs/5.1/getting-started/contents.md index 4e86d5592..07f6bdb98 100644 --- a/site/content/docs/5.1/getting-started/contents.md +++ b/site/content/docs/5.1/getting-started/contents.md @@ -171,7 +171,7 @@ bootstrap/ ├── site/ │ └──content/ │ └── docs/ -│ └── 5.1/ +│ └── {{< param docs_version >}}/ │ └── examples/ ├── js/ └── scss/ -- cgit v1.2.3 From d17801265e3562e5386b3445b84915618f5a81d7 Mon Sep 17 00:00:00 2001 From: Florian Lacreuse Date: Thu, 16 Dec 2021 09:27:00 +0100 Subject: Add sticky bottom utility (#35518) Co-authored-by: XhmikosR --- site/assets/scss/_component-examples.scss | 6 ++++-- site/content/docs/5.1/components/navbar.md | 12 ++++++++++-- site/content/docs/5.1/helpers/position.md | 21 ++++++++++++++++++++- 3 files changed, 34 insertions(+), 5 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index 208654ae0..f81a0af18 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -159,7 +159,8 @@ margin: -1rem -1rem 1rem; } - .fixed-bottom { + .fixed-bottom, + .sticky-bottom { position: static; margin: 1rem -1rem -1rem; } @@ -169,7 +170,8 @@ .sticky-top { margin: -1.5rem -1.5rem 1rem; } - .fixed-bottom { + .fixed-bottom, + .sticky-bottom { margin: 1rem -1.5rem -1.5rem; } } diff --git a/site/content/docs/5.1/components/navbar.md b/site/content/docs/5.1/components/navbar.md index 8d245d10f..57754e9b4 100644 --- a/site/content/docs/5.1/components/navbar.md +++ b/site/content/docs/5.1/components/navbar.md @@ -450,9 +450,9 @@ Use any of the responsive containers to change how wide the content in your navb ## Placement -Use our [position utilities]({{< docsref "/utilities/position" >}}) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the ``) to prevent overlap with other elements. +Use our [position utilities]({{< docsref "/utilities/position" >}}) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, stickied to the top (scrolls with the page until it reaches the top, then stays there), or stickied to the bottom (scrolls with the page until it reaches the bottom, then stays there). -Also note that **`.sticky-top` uses `position: sticky`, which [isn't fully supported in every browser](https://caniuse.com/css-sticky)**. +Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the ``) to prevent overlap with other elements. {{< example >}} {{< /example >}} +{{< example >}} + +{{< /example >}} + ## Scrolling Add `.navbar-nav-scroll` to a `.navbar-nav` (or other navbar sub-component) to enable vertical scrolling within the toggleable contents of a collapsed navbar. By default, scrolling kicks in at `75vh` (or 75% of the viewport height), but you can override that with the local CSS custom property `--bs-navbar-height` or custom styles. At larger viewports when the navbar is expanded, content will appear as it does in a default navbar. diff --git a/site/content/docs/5.1/helpers/position.md b/site/content/docs/5.1/helpers/position.md index d54c1c795..8b333bdfc 100644 --- a/site/content/docs/5.1/helpers/position.md +++ b/site/content/docs/5.1/helpers/position.md @@ -24,7 +24,7 @@ Position an element at the bottom of the viewport, from edge to edge. Be sure yo ## Sticky top -Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. The `.sticky-top` utility uses CSS's `position: sticky`, which isn't fully supported in all browsers. +Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. ```html
...
@@ -40,3 +40,22 @@ Responsive variations also exist for `.sticky-top` utility.
Stick to the top on viewports sized LG (large) or wider
Stick to the top on viewports sized XL (extra-large) or wider
``` + +## Sticky bottom + +Position an element at the bottom of the viewport, from edge to edge, but only after you scroll past it. + +```html +
...
+``` + +## Responsive sticky bottom + +Responsive variations also exist for `.sticky-bottom` utility. + +```html +
Stick to the bottom on viewports sized SM (small) or wider
+
Stick to the bottom on viewports sized MD (medium) or wider
+
Stick to the bottom on viewports sized LG (large) or wider
+
Stick to the bottom on viewports sized XL (extra-large) or wider
+``` -- cgit v1.2.3 From f729e4c7d1d92d2888c76db0e2590f7adfb3a16b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 16 Dec 2021 21:16:24 -0800 Subject: Convert alerts to CSS variables (#35401) Co-authored-by: XhmikosR --- site/content/docs/5.1/components/alerts.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.1/components/alerts.md b/site/content/docs/5.1/components/alerts.md index d54f7b9ce..97a9d4e3f 100644 --- a/site/content/docs/5.1/components/alerts.md +++ b/site/content/docs/5.1/components/alerts.md @@ -156,19 +156,27 @@ You can see this in action with a live demo: When an alert is dismissed, the element is completely removed from the page structure. If a keyboard user dismisses the alert using the close button, their focus will suddenly be lost and, depending on the browser, reset to the start of the page/document. For this reason, we recommend including additional JavaScript that listens for the `closed.bs.alert` event and programmatically sets `focus()` to the most appropriate location in the page. If you're planning to move focus to a non-interactive element that normally does not receive focus, make sure to add `tabindex="-1"` to the element. {{< /callout >}} -## Sass +## CSS ### Variables +Added in v5.2.0 + +As part of Bootstrap's evolving CSS variables approach, buttons now use local CSS variables on `.alert` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + +{{< scss-docs name="alert-css-vars" file="scss/_alert.scss" >}} + +### Sass variables + {{< scss-docs name="alert-variables" file="scss/_variables.scss" >}} -### Variant mixin +### Sass mixin Used in combination with `$theme-colors` to create contextual modifier classes for our alerts. {{< scss-docs name="alert-variant-mixin" file="scss/mixins/_alert.scss" >}} -### Loop +### Sass loop Loop that generates the modifier classes with the `alert-variant()` mixin. -- cgit v1.2.3 From 42162546f27314b36b6c26112303666246a7b67b Mon Sep 17 00:00:00 2001 From: Louis-Maxime Piton Date: Sat, 18 Dec 2021 12:53:36 +0100 Subject: docs: A fix for CSS Variables and some proposal (#35563) * docs: Fix CSS variables sections * Minor fix for dropdowns * Minor fixes for URLs Co-authored-by: XhmikosR --- site/content/docs/5.1/components/dropdowns.md | 16 ++++----- site/content/docs/5.1/content/reboot.md | 38 ++++++++++------------ .../docs/5.1/examples/cheatsheet-rtl/index.html | 2 +- .../docs/5.1/examples/cheatsheet/index.html | 2 +- site/content/docs/5.1/migration.md | 16 ++++----- 5 files changed, 35 insertions(+), 39 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.1/components/dropdowns.md b/site/content/docs/5.1/components/dropdowns.md index 2750ce540..7f2e2d42d 100644 --- a/site/content/docs/5.1/components/dropdowns.md +++ b/site/content/docs/5.1/components/dropdowns.md @@ -459,14 +459,14 @@ Trigger dropdown menus above elements by adding `.dropup` to the parent element. ``` -### Dropright +### Dropend Trigger dropdown menus at the right of the elements by adding `.dropend` to the parent element.
-
...
-
...
-
...
+
...
+
...
+
...
``` -And with vertical pills. +And with vertical pills. Ideally, for vertical tabs, you should also add `aria-orientation="vertical"` to the tab list container.
@@ -477,16 +471,16 @@ And with vertical pills.
-
+

This is some placeholder content the Home tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-
+

This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-
+

This is some placeholder content the Messages tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-
+

This is some placeholder content the Settings tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

@@ -502,14 +496,28 @@ And with vertical pills.
-
...
-
...
-
...
-
...
+
...
+
...
+
...
+
...
``` +### Accessibility + +Dynamic tabbed interfaces, as described in the [WAI ARIA Authoring Practices 1.2](https://www.w3.org/TR/wai-aria-practices-1.2/#tabpanel), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality, and current state to users of assistive technologies (such as screen readers). As a best practice, we recommend using `
@@ -430,13 +430,13 @@ The tabs plugin also works with pills.
-

This is some placeholder content the Home tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Home tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-

This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-

This is some placeholder content the Contact tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Contact tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

@@ -472,16 +472,16 @@ And with vertical pills. Ideally, for vertical tabs, you should also add `aria-o
-

This is some placeholder content the Home tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Home tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-

This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-

This is some placeholder content the Messages tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Messages tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-

This is some placeholder content the Settings tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

+

This is some placeholder content the Settings tab's associated content. Clicking another tab will toggle the visibility of this one for the next. The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav-powered navigation.

-- cgit v1.2.3 From fb21233098124c95c9fdfd54cb546739051464c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Thu, 14 Apr 2022 19:10:42 +0200 Subject: Fix Chroma line highlight style --- site/assets/scss/_syntax.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/assets/scss/_syntax.scss b/site/assets/scss/_syntax.scss index 56bc2840e..54f0cdaaa 100644 --- a/site/assets/scss/_syntax.scss +++ b/site/assets/scss/_syntax.scss @@ -17,7 +17,7 @@ --base0F: #333; } -.hll { background-color: #fff; } +.hl { background-color: var(--base02); } .c { color: var(--base03); } .err { color: var(--base08); } .k { color: var(--base0E); } -- cgit v1.2.3 From 26ea6f1649c51d2a7edc796221bd5b46b289bb28 Mon Sep 17 00:00:00 2001 From: MelanieL Date: Sat, 16 Apr 2022 14:10:27 -0400 Subject: Fix containers page in docs to re-order list so it matches sections below it. --- site/content/docs/5.1/layout/containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.1/layout/containers.md b/site/content/docs/5.1/layout/containers.md index 6557bea4e..6801aca6b 100644 --- a/site/content/docs/5.1/layout/containers.md +++ b/site/content/docs/5.1/layout/containers.md @@ -13,8 +13,8 @@ Containers are the most basic layout element in Bootstrap and are **required whe Bootstrap comes with three different containers: - `.container`, which sets a `max-width` at each responsive breakpoint -- `.container-fluid`, which is `width: 100%` at all breakpoints - `.container-{breakpoint}`, which is `width: 100%` until the specified breakpoint +- `.container-fluid`, which is `width: 100%` at all breakpoints The table below illustrates how each container's `max-width` compares to the original `.container` and `.container-fluid` across each breakpoint. -- cgit v1.2.3 From 195440f2fb1e94c014a9cf08f3eae40f3d224620 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 17 Apr 2022 22:17:50 -0700 Subject: v5.2.0 design refresh, plus responsive offcanvas classes (#35736) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add responsive offcanvas classes - Updates navbar-expand classes to de-dupe some styles—these shouldn't interfere now. - Adds some JS to the offcanvas component to help with responsiveness Co-Authored-By: GeoSot * Redesign homepage, docs, and examples Homepage: - New Bootstrap purple navbar - Redesigned masthead - Rewrote and redesigned homepage content - Replace Copy text with icons like Bootstrap Icons site across all ClipboardJS instances - Fixed padding issues in site footer - Match homepage button styles to examples page, use gap instead of tons of responsive margin utils Docs: - New navbar, no more subnav. Migrated search and version picker into the main navbar and refreshed the design of it all, including the responsive toggles. - New sidebar navigation is always expanded, and now features Bootstrap Icons alongside section headings - Sidebar navigation autoscrolls to active link for better usability - Subnav and navbar padding issues ironed out - Enhanced the version picker in anticipation of v5.2: we can now link right to the same page in the previous version. - Redesign callouts to add more color to our pages - Collapse table of contents on mobile - Cleanup and redesign button styles with CSS variables - Update design for subnav version dropdown - Update highlight and example to be full-width until md - Improve the Added In badges - Turn the ToC into a well on mobile - Redesign code snippets to better house two action buttons Examples: - Redesign Examples page layout - Add new example for responsive offcanvases in navbars * Convert offcanvas to CSS vars * Feat: add resize handler to Offcanvas.js. If we could use as default the `.offcanvas` class without modifiers, we then, could add a simplified selector The selector itself, ignores the .offcanvas class as it doesn't have any responsive behavior The `aria-modal` addon is to protect us, selection backdrop elements * Separate examples code, Add some selectors, fix stackblitz btn Co-authored-by: GeoSot --- site/assets/js/application.js | 74 +---- site/assets/js/code-examples.js | 88 ++++++ site/assets/js/search.js | 7 +- site/assets/scss/_ads.scss | 5 +- site/assets/scss/_algolia.scss | 7 +- site/assets/scss/_buttons.scss | 16 +- site/assets/scss/_callouts.scss | 30 +- site/assets/scss/_clipboard-js.scss | 37 ++- site/assets/scss/_component-examples.scss | 42 ++- site/assets/scss/_content.scss | 59 +++- site/assets/scss/_layout.scss | 19 +- site/assets/scss/_masthead.scss | 77 ++++- site/assets/scss/_navbar.scss | 85 +++-- site/assets/scss/_search.scss | 62 ++++ site/assets/scss/_sidebar.scss | 90 ++---- site/assets/scss/_subnav.scss | 82 ----- site/assets/scss/_syntax.scss | 2 +- site/assets/scss/_toc.scss | 45 +++ site/assets/scss/_variables.scss | 12 +- site/assets/scss/docs.scss | 2 +- site/content/docs/5.1/components/offcanvas.md | 57 +++- site/content/docs/5.1/examples/_index.md | 57 ++-- .../docs/5.1/examples/navbars-offcanvas/index.html | 147 +++++++++ .../docs/5.1/examples/navbars-offcanvas/navbar.css | 7 + site/content/docs/5.1/utilities/api.md | 2 +- site/content/docs/5.1/utilities/spacing.md | 4 +- site/data/examples.yml | 2 + site/data/plugins.yml | 47 +++ site/data/sidebar.yml | 20 ++ site/layouts/_default/baseof.html | 1 + site/layouts/_default/docs.html | 38 ++- site/layouts/_default/single.html | 17 +- site/layouts/partials/docs-navbar.html | 103 ++++--- site/layouts/partials/docs-sidebar.html | 37 +-- site/layouts/partials/docs-subnav.html | 14 - site/layouts/partials/docs-versions.html | 26 +- site/layouts/partials/favicons.html | 4 +- site/layouts/partials/footer.html | 5 +- site/layouts/partials/home/masthead-followup.html | 342 ++++++++++++++++++--- site/layouts/partials/home/masthead.html | 50 +-- site/layouts/partials/icons.html | 72 +++++ site/layouts/partials/scripts.html | 3 +- site/layouts/shortcodes/example.html | 39 ++- .../5.1/assets/img/examples/navbars-offcanvas.png | Bin 0 -> 6919 bytes .../assets/img/examples/navbars-offcanvas@2x.png | Bin 0 -> 17121 bytes 45 files changed, 1404 insertions(+), 531 deletions(-) create mode 100644 site/assets/js/code-examples.js create mode 100644 site/assets/scss/_search.scss delete mode 100644 site/assets/scss/_subnav.scss create mode 100644 site/content/docs/5.1/examples/navbars-offcanvas/index.html create mode 100644 site/content/docs/5.1/examples/navbars-offcanvas/navbar.css create mode 100644 site/data/plugins.yml delete mode 100644 site/layouts/partials/docs-subnav.html create mode 100644 site/layouts/partials/icons.html create mode 100644 site/static/docs/5.1/assets/img/examples/navbars-offcanvas.png create mode 100644 site/static/docs/5.1/assets/img/examples/navbars-offcanvas@2x.png (limited to 'site') diff --git a/site/assets/js/application.js b/site/assets/js/application.js index c14dc57c2..55e896980 100644 --- a/site/assets/js/application.js +++ b/site/assets/js/application.js @@ -10,11 +10,26 @@ * For details, see https://creativecommons.org/licenses/by/3.0/. */ -/* global ClipboardJS: false, bootstrap: false */ +/* global bootstrap: false */ (() => { 'use strict' + // Scroll the active sidebar link into view + const sidenav = document.querySelector('.bd-sidebar') + if (sidenav) { + const sidenavHeight = sidenav.clientHeight + const sidenavActiveLink = document.querySelector('.bd-links-nav .active') + const sidenavActiveLinkTop = sidenavActiveLink.offsetTop + const sidenavActiveLinkHeight = sidenavActiveLink.clientHeight + const viewportTop = sidenavActiveLinkTop + const viewportBottom = viewportTop - sidenavHeight + sidenavActiveLinkHeight + + if (sidenav.scrollTop > viewportTop || sidenav.scrollTop < viewportBottom) { + sidenav.scrollTop = viewportTop - (sidenavHeight / 2) + (sidenavActiveLinkHeight / 2) + } + } + // Tooltip and popover demos document.querySelectorAll('.tooltip-demo') .forEach(tooltip => { @@ -116,61 +131,4 @@ modalBodyInput.value = recipient }) } - - // Insert copy to clipboard button before .highlight - const btnTitle = 'Copy to clipboard' - const btnEdit = 'Edit on StackBlitz' - const btnHtml = '
' - document.querySelectorAll('div.highlight') - .forEach(element => { - element.insertAdjacentHTML('beforebegin', btnHtml) - }) - - /** - * - * @param {string} selector - * @param {string} title - */ - function snippetButtonTooltip(selector, title) { - document.querySelectorAll(selector).forEach(btn => { - const tooltipBtn = new bootstrap.Tooltip(btn, { title }) - - btn.addEventListener('mouseleave', () => { - // Explicitly hide tooltip, since after clicking it remains - // focused (as it's a button), so tooltip would otherwise - // remain visible until focus is moved away - tooltipBtn.hide() - }) - }) - } - - snippetButtonTooltip('.btn-clipboard', btnTitle) - snippetButtonTooltip('.btn-edit', btnEdit) - - const clipboard = new ClipboardJS('.btn-clipboard', { - target(trigger) { - return trigger.parentNode.nextElementSibling - } - }) - - clipboard.on('success', event => { - const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) - - tooltipBtn.setContent({ '.tooltip-inner': 'Copied!' }) - event.trigger.addEventListener('hidden.bs.tooltip', () => { - tooltipBtn.setContent({ '.tooltip-inner': btnTitle }) - }, { once: true }) - event.clearSelection() - }) - - clipboard.on('error', event => { - const modifierKey = /mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-' - const fallbackMsg = `Press ${modifierKey}C to copy` - const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) - - tooltipBtn.setContent({ '.tooltip-inner': fallbackMsg }) - event.trigger.addEventListener('hidden.bs.tooltip', () => { - tooltipBtn.setContent({ '.tooltip-inner': btnTitle }) - }, { once: true }) - }) })() diff --git a/site/assets/js/code-examples.js b/site/assets/js/code-examples.js new file mode 100644 index 000000000..4a61fa09b --- /dev/null +++ b/site/assets/js/code-examples.js @@ -0,0 +1,88 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ + +/*! + * JavaScript for Bootstrap's docs (https://getbootstrap.com/) + * Copyright 2011-2022 The Bootstrap Authors + * Copyright 2011-2022 Twitter, Inc. + * Licensed under the Creative Commons Attribution 3.0 Unported License. + * For details, see https://creativecommons.org/licenses/by/3.0/. + */ + +/* global ClipboardJS: false, bootstrap: false */ + +(() => { + 'use strict' + // Insert copy to clipboard button before .highlight + const btnTitle = 'Copy to clipboard' + const btnEdit = 'Edit on StackBlitz' + + const btnHtml = [ + '
', + '
', + ' ', + '
', + '
' + ].join('') + + // wrap programmatically code blocks and add copy btn. + document.querySelectorAll('.highlight') + .forEach(element => { + if (!element.closest('.bd-example-snippet')) { // Ignore examples made be shortcode + element.insertAdjacentHTML('beforebegin', btnHtml) + element.previousElementSibling.append(element) + } + }) + + /** + * + * @param {string} selector + * @param {string} title + */ + function snippetButtonTooltip(selector, title) { + document.querySelectorAll(selector).forEach(btn => { + bootstrap.Tooltip.getOrCreateInstance(btn, { title }) + }) + } + + snippetButtonTooltip('.btn-clipboard', btnTitle) + snippetButtonTooltip('.btn-edit', btnEdit) + + const clipboard = new ClipboardJS('.btn-clipboard', { + target: trigger => trigger.closest('.bd-code-snippet').querySelector('.highlight') + }) + + clipboard.on('success', event => { + const iconFirstChild = event.trigger.querySelector('.bi').firstChild + const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) + const namespace = 'http://www.w3.org/1999/xlink' + const originalXhref = iconFirstChild.getAttributeNS(namespace, 'href') + const originalTitle = event.trigger.title + + tooltipBtn.setContent({ '.tooltip-inner': 'Copied!' }) + event.trigger.addEventListener('hidden.bs.tooltip', () => { + tooltipBtn.setContent({ '.tooltip-inner': btnTitle }) + }, { once: true }) + event.clearSelection() + iconFirstChild.setAttributeNS(namespace, 'href', originalXhref.replace('clipboard', 'check2')) + + setTimeout(() => { + iconFirstChild.setAttributeNS(namespace, 'href', originalXhref) + event.trigger.title = originalTitle + }, 2000) + }) + + clipboard.on('error', event => { + const modifierKey = /mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-' + const fallbackMsg = `Press ${modifierKey}C to copy` + const tooltipBtn = bootstrap.Tooltip.getInstance(event.trigger) + + tooltipBtn.setContent({ '.tooltip-inner': fallbackMsg }) + event.trigger.addEventListener('hidden.bs.tooltip', () => { + tooltipBtn.setContent({ '.tooltip-inner': btnTitle }) + }, { once: true }) + }) +})() diff --git a/site/assets/js/search.js b/site/assets/js/search.js index 15197bfd9..6c90a2087 100644 --- a/site/assets/js/search.js +++ b/site/assets/js/search.js @@ -14,12 +14,17 @@ const siteDocsVersion = inputElement.getAttribute('data-bd-docs-version') document.addEventListener('keydown', event => { - if (event.ctrlKey && event.key === '/') { + if ((((event.ctrlKey || event.metaKey) && event.key === 'k')) || (event.ctrlKey && event.key === '/')) { event.preventDefault() inputElement.focus() } }) + if (navigator.platform.includes('Win') || navigator.platform.includes('Linux')) { + const searchShortcut = document.querySelector('.bd-search') + searchShortcut.setAttribute('data-shortcut', '⌃K') + } + window.docsearch({ apiKey: '5990ad008512000bba2cf951ccf0332f', indexName: 'bootstrap', diff --git a/site/assets/scss/_ads.scss b/site/assets/scss/_ads.scss index 026d1a17a..b9369eb19 100644 --- a/site/assets/scss/_ads.scss +++ b/site/assets/scss/_ads.scss @@ -14,7 +14,7 @@ @include font-size(.8125rem); line-height: 1.4; text-align: left; - background-color: rgba(0, 0, 0, .05); + background-color: $gray-100; a { color: $gray-800; @@ -22,8 +22,7 @@ } @include media-breakpoint-up(sm) { - max-width: 330px; - @include border-radius(4px); + @include border-radius(.5rem); } } diff --git a/site/assets/scss/_algolia.scss b/site/assets/scss/_algolia.scss index 9c457d2e3..ab22ad9a7 100644 --- a/site/assets/scss/_algolia.scss +++ b/site/assets/scss/_algolia.scss @@ -12,12 +12,15 @@ margin: $dropdown-spacer 0 0; @include font-size(.875rem); background-color: $dropdown-bg; + background-clip: padding-box; border: $dropdown-border-width solid $dropdown-border-color; @include border-radius($dropdown-border-radius); - @include box-shadow($dropdown-box-shadow); + box-shadow: $dropdown-box-shadow; @include media-breakpoint-up(md) { - width: 400px; + width: 500px; + margin-top: .5rem; + margin-left: -110px; } } diff --git a/site/assets/scss/_buttons.scss b/site/assets/scss/_buttons.scss index 93ffa83ed..13bd6e48a 100644 --- a/site/assets/scss/_buttons.scss +++ b/site/assets/scss/_buttons.scss @@ -8,10 +8,14 @@ --bs-btn-color: var(--bs-white); --bs-btn-bg: var(--bd-violet); --bs-btn-border-color: var(--bd-violet); + --bs-btn-border-radius: .5rem; --bs-btn-hover-color: var(--bs-white); - --bs-btn-hover-bg: #{shade-color($bd-violet, 20%)}; - --bs-btn-hover-border-color: #{shade-color($bd-violet, 20%)}; + --bs-btn-hover-bg: #{shade-color($bd-violet, 10%)}; + --bs-btn-hover-border-color: #{shade-color($bd-violet, 10%)}; --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); + --bs-btn-active-color: var(--bs-btn-hover-color); + --bs-btn-active-bg: #{shade-color($bd-violet, 20%)}; + --bs-btn-active-border-color: #{shade-color($bd-violet, 20%)}; } // scss-docs-end btn-css-vars-example @@ -23,13 +27,19 @@ --bs-btn-hover-bg: var(--bd-accent); --bs-btn-hover-border-color: var(--bd-accent); --bs-btn-focus-shadow-rgb: var(--bd-accent-rgb); + --bs-btn-active-color: var(--bs-btn-hover-color); + --bs-btn-active-bg: var(--bs-btn-hover-bg); + --bs-btn-active-border-color: var(--bs-btn-hover-border-color); } .btn-bd-light { --bs-btn-color: var(--bs-gray-600); - --bs-btn-border-color: var(--bs-gray-300); + --bs-btn-border-color: var(--bs-gray-400); + --bs-btn-hover-color: var(--bd-violet); + --bs-btn-hover-border-color: var(--bd-violet); --bs-btn-active-color: var(--bd-violet); --bs-btn-active-bg: var(--bs-white); --bs-btn-active-border-color: var(--bd-violet); + --bs-btn-focus-border-color: var(--bd-violet); --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); } diff --git a/site/assets/scss/_callouts.scss b/site/assets/scss/_callouts.scss index aff91f18b..4513a7d1d 100644 --- a/site/assets/scss/_callouts.scss +++ b/site/assets/scss/_callouts.scss @@ -6,36 +6,30 @@ padding: 1.25rem; margin-top: 1.25rem; margin-bottom: 1.25rem; - border: 1px solid $gray-200; - border-left-width: .25rem; - @include border-radius(); + background-color: var(--bd-callout-bg, var(--bs-gray-100)); + border-left: .25rem solid var(--bd-callout-border, var(--bs-gray-300)); h4 { margin-bottom: .25rem; } - p:last-child { + > :last-child { margin-bottom: 0; } - code { - @include border-radius(); - } - + .bd-callout { margin-top: -.25rem; } -} -// Variations -.bd-callout-info { - border-left-color: $bd-info; -} - -.bd-callout-warning { - border-left-color: $bd-warning; + .highlight { + background-color: rgba($black, .05); + } } -.bd-callout-danger { - border-left-color: $bd-danger; +// Variations +@each $variant in $bd-callout-variants { + .bd-callout-#{$variant} { + --bd-callout-bg: rgba(var(--bs-#{$variant}-rgb), .075); + --bd-callout-border: rgba(var(--bs-#{$variant}-rgb), .5); + } } diff --git a/site/assets/scss/_clipboard-js.scss b/site/assets/scss/_clipboard-js.scss index b2b0854dc..7acf90f0b 100644 --- a/site/assets/scss/_clipboard-js.scss +++ b/site/assets/scss/_clipboard-js.scss @@ -19,26 +19,29 @@ .btn-clipboard, .btn-edit { - position: absolute; - top: .65rem; - right: .65rem; - z-index: 10; display: block; - padding: .25rem .5rem; - @include font-size(.65em); - color: $primary; - white-space: nowrap; - background-color: $white; - border: 1px solid; - @include border-radius(); + padding: .5em; + line-height: 1; + color: $gray-900; + background-color: $gray-100; + border: 0; + @include border-radius(.25rem); - &:hover, - &:focus { - color: $white; - background-color: $primary; + &:hover { + color: $primary; } } -.btn-edit { - right: 3.65rem; +.btn-clipboard { + position: relative; + z-index: 2; + margin-top: .75rem; + margin-right: .75rem; +} + +.highlight-toolbar { + .btn-clipboard { + margin-top: 0; + margin-right: 0; + } } diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index 330bd43ba..b305f088f 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -85,21 +85,17 @@ .bd-example { position: relative; padding: 1rem; - margin: 1rem ($bd-gutter-x * -1) 0; - border: solid $gray-300; + margin: 1rem ($bd-gutter-x * -.5) 0; + border: solid $border-color; border-width: 1px 0 0; @include clearfix(); - @include media-breakpoint-up(sm) { + @include media-breakpoint-up(md) { padding: 1.5rem; margin-right: 0; margin-left: 0; border-width: 1px; - @include border-top-radius(.25rem); - - + .bd-clipboard + .highlight { - @include border-bottom-radius(.25rem); - } + @include border-top-radius(var(--bs-border-radius)); } + p { @@ -348,12 +344,14 @@ // .highlight { - padding: var(--bs-gutter-x) $bd-gutter-x; + position: relative; + padding: .75rem ($bd-gutter-x * .5); margin-bottom: 1rem; background-color: var(--bs-gray-100); - @include media-breakpoint-up(sm) { - padding: 1rem 1.5rem; + @include media-breakpoint-up(md) { + padding: .75rem 1.25rem; + @include border-radius(var(--bs-border-radius)); } pre { @@ -363,6 +361,11 @@ white-space: pre; background-color: transparent; border: 0; + + // Undo tabindex that's automatically added by Hugo + &:focus { + outline: 0; + } } pre code { @@ -372,11 +375,22 @@ } } +.bd-example-snippet { + .highlight { + @include border-top-radius(0); + border: 1px solid $border-color; + } + .highlight-toolbar { + border: solid $border-color; + border-width: 0 1px; + } +} + .bd-content .highlight { - margin-right: $bd-gutter-x * -1; - margin-left: $bd-gutter-x * -1; + margin-right: $bd-gutter-x * -.5; + margin-left: $bd-gutter-x * -.5; - @include media-breakpoint-up(sm) { + @include media-breakpoint-up(md) { margin-right: 0; margin-left: 0; } diff --git a/site/assets/scss/_content.scss b/site/assets/scss/_content.scss index d796c491e..cd594335a 100644 --- a/site/assets/scss/_content.scss +++ b/site/assets/scss/_content.scss @@ -2,14 +2,13 @@ // Bootstrap docs content theming // -// Offset for the sticky header -@include media-breakpoint-up(md) { - :root { - scroll-padding-top: 4rem; +.bd-content { + // Offset content from fixed navbar when jumping to headings + > :target { + padding-top: 5rem; + margin-top: -5rem; } -} -.bd-content { > h2:not(:first-child) { margin-top: 3rem; } @@ -46,6 +45,10 @@ border-bottom: 2px solid currentcolor; } + tbody:not(:first-child) { + border-top: 2px solid currentcolor; + } + th, td { &:first-child { @@ -59,12 +62,24 @@ // Prevent breaking of code // stylelint-disable-next-line selector-max-compound-selectors + th, td:first-child > code { white-space: nowrap; } } } +.table-options { + td:nth-child(2) { + min-width: 160px; + } +} + +.table-options td:last-child, +.table-utilities td:last-child { + min-width: 280px; +} + .bd-title { @include font-size(3rem); } @@ -77,3 +92,35 @@ .bd-bg-violet { background-color: $bd-violet; } + +.bi { + width: 1em; + height: 1em; + fill: currentcolor; +} + +.icon-link { + display: flex; + align-items: center; + text-decoration-color: rgba($primary, .5); + text-underline-offset: .5rem; + backface-visibility: hidden; + + .bi { + width: 1.5em; + height: 1.5em; + transition: .2s ease-in-out transform; // stylelint-disable-line property-disallowed-list + } + + &:hover { + .bi { + transform: translate3d(5px, 0, 0); + } + } +} + +.border-lg-start { + @include media-breakpoint-up(lg) { + border-left: $border-width solid $border-color; + } +} diff --git a/site/assets/scss/_layout.scss b/site/assets/scss/_layout.scss index f83cf094c..d0482d9b7 100644 --- a/site/assets/scss/_layout.scss +++ b/site/assets/scss/_layout.scss @@ -1,16 +1,14 @@ +.bd-gutter { + --bs-gutter-x: #{$bd-gutter-x}; +} + .bd-layout { - padding-right: $bd-gutter-x; - padding-left: $bd-gutter-x; - @include media-breakpoint-up(md) { + @include media-breakpoint-up(lg) { display: grid; grid-template-areas: "sidebar main"; - grid-template-columns: 1fr 3fr; - gap: $grid-gutter-width; - } - - @include media-breakpoint-up(lg) { grid-template-columns: 1fr 5fr; + gap: $grid-gutter-width; } } @@ -21,6 +19,11 @@ .bd-main { grid-area: main; + @include media-breakpoint-down(lg) { + max-width: 760px; + margin-inline: auto; + } + @include media-breakpoint-up(md) { display: grid; grid-template-areas: diff --git a/site/assets/scss/_masthead.scss b/site/assets/scss/_masthead.scss index 2e742e76d..42ad0f385 100644 --- a/site/assets/scss/_masthead.scss +++ b/site/assets/scss/_masthead.scss @@ -1,38 +1,87 @@ .bd-masthead { + --bd-pink-rgb: #{to-rgb($pink)}; padding: 3rem 0; - background: linear-gradient(165deg, tint-color($bd-purple-light, 85%) 50%, $white 50%); + // stylelint-disable + background-image: linear-gradient(180deg, rgba(var(--bs-body-bg-rgb), .01), rgba(var(--bs-body-bg-rgb), 1) 85%), + radial-gradient(ellipse at top left, rgba(var(--bs-primary-rgb), .5), transparent 50%), + radial-gradient(ellipse at top right, rgba(var(--bd-accent-rgb), .5), transparent 50%), + radial-gradient(ellipse at center right, rgba(var(--bd-violet-rgb), .5), transparent 50%), + radial-gradient(ellipse at center left, rgba(var(--bd-pink-rgb), .5), transparent 50%); + // stylelint-enable h1 { @include font-size(4rem); line-height: 1; } - p:not(.lead) { + .lead { + @include font-size(1rem); + font-weight: 400; color: $gray-700; } - .btn { - padding: .8rem 2rem; - font-weight: 600; + .highlight { + padding: .5rem 4rem .5rem 1rem; + margin-bottom: 0; + line-height: 1.25; + background-color: rgba(var(--bs-body-color-rgb), .075); + @include border-radius(.5rem); + } + .btn-clipboard { + margin-top: .4rem; + background-color: transparent; + } + + #carbonads { // stylelint-disable-line selector-max-id + margin-right: auto; + margin-left: auto; } + + @include media-breakpoint-up(md) { + .lead { + @include font-size(1.5rem); + } + } +} + +.masthead-followup { .lead { - @include font-size(1.5rem); - font-weight: 400; - color: $gray-700; + @include font-size(1rem); + } + + .highlight { + @include border-radius(.5rem); + } + + @include media-breakpoint-up(md) { + .lead { + @include font-size(1.25rem); + } } } -@include media-breakpoint-up(md) { - .mw-md-75 { max-width: 75%; } +.bd-btn-lg { + padding: .8rem 2rem; } .masthead-followup-icon { - padding: .75rem; - background-image: linear-gradient(to bottom right, rgba(255, 255, 255, .2), rgba(255, 255, 255, .01)); - @include border-radius(.75rem); - box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .1); + padding: 1rem; + color: rgba(var(--bg-rgb), 1); + background-color: rgba(var(--bg-rgb), .1); + background-blend-mode: multiple; + @include border-radius(1rem); + mix-blend-mode: darken; + + svg { + filter: drop-shadow(0 1px 1px #fff); + } } .masthead-followup-svg { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .125)); } + +.masthead-notice { + background-color: var(--bd-accent); + box-shadow: inset 0 -1px 1px rgba(var(--bs-body-color-rgb), .15), 0 .25rem 1.5rem rgba(var(--bs-body-bg-rgb), .75); +} diff --git a/site/assets/scss/_navbar.scss b/site/assets/scss/_navbar.scss index 401731ae1..4f9f3f829 100644 --- a/site/assets/scss/_navbar.scss +++ b/site/assets/scss/_navbar.scss @@ -1,44 +1,85 @@ .bd-navbar { - --bs-gutter-x: $bd-gutter-x; - --bs-gutter-y: $bd-gutter-x; - padding: .75rem 0; - background-color: $bd-violet; + background-color: transparent; + background-image: linear-gradient(to bottom, rgba(var(--bd-violet-rgb), 1), rgba(var(--bd-violet-rgb), .95)); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15), inset 0 -1px 0 rgba(0, 0, 0, .15); .navbar-toggler { padding: 0; + margin-right: -.5rem; border: 0; + + &:first-child { + margin-left: -.5rem; + } + + .bi { + width: 1.5rem; + height: 1.5rem; + } + + &:focus { + box-shadow: none; + } } - .navbar-nav { - .nav-link { - padding-right: $spacer * .25; - padding-left: $spacer * .25; - color: rgba($white, .85); + .navbar-brand { + transition: .2s ease-in-out transform; // stylelint-disable-line property-disallowed-list + + &:hover { + transform: rotate(-5deg) scale(1.1); + } + } - &:hover, - &:focus { - color: $white; - } + .navbar-toggler, + .nav-link { + padding-right: $spacer * .25; + padding-left: $spacer * .25; + color: rgba($white, .85); - &.active { - font-weight: 600; - color: $white; - } + &:hover, + &:focus { + color: $white; + } + + &.active { + font-weight: 600; + color: $white; } } .navbar-nav-svg { - width: 1rem; - height: 1rem; + display: inline-block; + vertical-align: -.125rem; } - .offcanvas { - background-color: $bd-violet; + .offcanvas-lg { + background-color: var(--bd-violet); border-left: 0; - @include media-breakpoint-down(md) { + @include media-breakpoint-down(lg) { box-shadow: $box-shadow-lg; } } + + .dropdown-toggle { + &:focus { + outline: 0; + } + } + + .dropdown-menu { + --#{$variable-prefix}dropdown-min-width: 12rem; + --#{$variable-prefix}dropdown-link-hover-bg: rgba(var(--bd-violet-rgb), .1); + @include rfs(.875rem, --#{$variable-prefix}dropdown-font-size); + box-shadow: $dropdown-box-shadow; + } + + .dropdown-item.current { + font-weight: 600; + background-image: escape-svg($dropdown-active-icon); + background-repeat: no-repeat; + background-position: right $dropdown-item-padding-x top .6rem; + background-size: .75rem .75rem; + } } diff --git a/site/assets/scss/_search.scss b/site/assets/scss/_search.scss new file mode 100644 index 000000000..1825337a0 --- /dev/null +++ b/site/assets/scss/_search.scss @@ -0,0 +1,62 @@ +.bd-search { + position: relative; + width: 100%; + + &::after { + position: absolute; + top: .4rem; + right: .4rem; + bottom: .4rem; + display: flex; + align-items: center; + justify-content: center; + padding-right: .3125rem; + padding-left: .3125rem; + @include font-size(.75rem); + color: rgba($white, .65); + // content: "⌘K"; + content: attr(data-shortcut); + background-color: rgba($white, .1); + @include border-radius(.125rem); + } + + @include media-breakpoint-up(lg) { + position: absolute; + top: .75rem; + left: 50%; + width: 200px; + margin-left: -100px; + } + + @include media-breakpoint-up(xl) { + width: 280px; + margin-left: -140px; + } + + .form-control { + padding-right: 2.75rem; + color: $white; + background-color: rgba($black, .1); + border-color: rgba($white, .4); + transition-property: background-color, border-color, box-shadow; + + &::placeholder { + color: rgba($white, .65); + } + + &::-webkit-search-cancel-button { + appearance: none; + width: 1rem; + height: 1rem; + cursor: pointer; + background: escape-svg($search-clear-icon) no-repeat 0 0; + background-size: 100% 100%; + } + + &:focus { + background-color: rgba($black, .25); + border-color: rgba($bd-accent, 1); + box-shadow: 0 0 0 .25rem rgba($bd-accent, .4); + } + } +} diff --git a/site/assets/scss/_sidebar.scss b/site/assets/scss/_sidebar.scss index 452b155ff..ed76b3ca8 100644 --- a/site/assets/scss/_sidebar.scss +++ b/site/assets/scss/_sidebar.scss @@ -1,87 +1,53 @@ .bd-sidebar { - @include media-breakpoint-down(md) { - margin: 0 ($bd-gutter-x * -1) 1rem; - } -} - -.bd-links { - overflow: auto; - font-weight: 600; - - @include media-breakpoint-up(md) { + @include media-breakpoint-up(lg) { position: sticky; top: 5rem; // Override collapse behaviors // stylelint-disable-next-line declaration-no-important display: block !important; - height: subtract(100vh, 7rem); + height: subtract(100vh, 6rem); // Prevent focus styles to be cut off: padding-left: .25rem; margin-left: -.25rem; overflow-y: auto; } +} - > ul { - @include media-breakpoint-down(md) { - padding: 1.5rem .75rem; - background-color: $gray-100; - border-bottom: 1px solid $gray-200; - } - } - - a { - padding: .1875rem .5rem; - margin-top: .125rem; - margin-left: 1.25rem; - color: rgba($black, .65); - text-decoration: if($link-decoration == none, null, none); - - &:hover, - &:focus { - color: rgba($black, .85); - text-decoration: if($link-hover-decoration == underline, none, null); - background-color: rgba($bd-violet, .1); - } +.bd-links-nav { + @include media-breakpoint-down(lg) { + font-size: .875rem; } - .btn { - // Custom styles (as we don't have a completely neutral button style) - padding: .25rem .5rem; - font-weight: 600; - color: rgba($black, .65); - background-color: transparent; - border: 0; + @include media-breakpoint-between(xs, lg) { + column-count: 2; + column-gap: 1.5rem; - &:hover, - &:focus { - color: rgba($black, .85); - background-color: rgba($bd-violet, .1); + .bd-links-group { + break-inside: avoid; } - &:focus { - box-shadow: 0 0 0 1px rgba($bd-violet, .7); - } - - // Add chevron if there's a submenu - &::before { - width: 1.25em; - line-height: 0; // Align in the middle - content: escape-svg($sidebar-collapse-icon); - @include transition(transform .35s ease); - transform-origin: .5em 50%; + .bd-links-span-all { + column-span: all; } + } +} - &[aria-expanded="true"] { - color: rgba($black, .85); +.bd-links-link { + padding: .1875rem .5rem; + margin-top: .125rem; + margin-left: 1rem; + color: rgba($black, .65); + text-decoration: if($link-decoration == none, null, none); - &::before { - transform: rotate(90deg); - } - } + &:hover, + &:focus, + &.active { + color: rgba($black, .85); + text-decoration: if($link-hover-decoration == underline, none, null); + background-color: rgba(var(--bd-violet-rgb), .1); } - .active { + &.active { font-weight: 600; - color: rgba($black, .85); } } diff --git a/site/assets/scss/_subnav.scss b/site/assets/scss/_subnav.scss deleted file mode 100644 index db183ff6a..000000000 --- a/site/assets/scss/_subnav.scss +++ /dev/null @@ -1,82 +0,0 @@ -.bd-subnavbar { - --bs-gutter-x: $bd-gutter-x; - --bs-gutter-y: $bd-gutter-x; - - // The position and z-index are needed for the dropdown to stay on top of the content - position: relative; - z-index: $zindex-sticky; - background-color: rgba($white, .95); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .05), inset 0 -1px 0 rgba(0, 0, 0, .15); - - .dropdown-menu { - @include font-size(.875rem); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .05); - } - - .dropdown-item.current { - font-weight: 600; - background-image: escape-svg($dropdown-active-icon); - background-repeat: no-repeat; - background-position: right $dropdown-item-padding-x top .6rem; - background-size: .75rem .75rem; - } - - @include media-breakpoint-up(md) { - position: sticky; - top: 0; - } -} - -.bd-search { - position: relative; - - &::after { - position: absolute; - top: .4rem; - right: .4rem; - bottom: .4rem; - display: flex; - align-items: center; - justify-content: center; - padding-right: .3125rem; - padding-left: .3125rem; - @include font-size(.75rem); - color: $gray-600; - content: "Ctrl + /"; - background-color: $gray-100; - @include border-radius(.125rem); - } - - @include media-breakpoint-down(md) { - width: 100%; - } - - .form-control { - padding-right: 3.75rem; - - &:focus { - border-color: $bd-violet; - box-shadow: 0 0 0 3px rgba($bd-violet, .25); - } - } -} - -.bd-sidebar-toggle { - color: $text-muted; - - &:hover, - &:focus { - color: $bd-violet; - } - - &:focus { - box-shadow: 0 0 0 3px rgba($bd-violet, .25); - } - - .bi-collapse { display: none; } - - &:not(.collapsed) { - .bi-expand { display: none; } - .bi-collapse { display: inline-block; } - } -} diff --git a/site/assets/scss/_syntax.scss b/site/assets/scss/_syntax.scss index 54f0cdaaa..662f70dc4 100644 --- a/site/assets/scss/_syntax.scss +++ b/site/assets/scss/_syntax.scss @@ -101,7 +101,7 @@ .language-bash, .language-sh { &::before { - color: #009; + color: #777; content: "$ "; user-select: none; } diff --git a/site/assets/scss/_toc.scss b/site/assets/scss/_toc.scss index 596945628..512a11b42 100644 --- a/site/assets/scss/_toc.scss +++ b/site/assets/scss/_toc.scss @@ -15,6 +15,7 @@ ul { padding-left: 0; + margin-bottom: 0; list-style: none; ul { @@ -40,3 +41,47 @@ } } } + +.bd-toc-toggle { + display: flex; + align-items: center; + + @include media-breakpoint-down(sm) { + justify-content: space-between; + width: 100%; + } + + @include media-breakpoint-down(md) { + border: 1px solid $border-color; + @include border-radius(.4rem); + + &:hover, + &:focus, + &:active, + &[aria-expanded="true"] { + color: var(--bd-violet); + background-color: $white; + border-color: var(--bd-violet); + } + + &:focus, + &[aria-expanded="true"] { + box-shadow: 0 0 0 3px rgba(var(--bd-violet-rgb), .25); + } + } +} + +.bd-toc-collapse { + @include media-breakpoint-down(md) { + nav { + padding: 1.25rem; + background-color: var(--bs-gray-100); + border: 1px solid $border-color; + @include border-radius(.25rem); + } + } + + @include media-breakpoint-up(md) { + display: block !important; // stylelint-disable-line declaration-no-important + } +} diff --git a/site/assets/scss/_variables.scss b/site/assets/scss/_variables.scss index 0c40b17e9..8f74f94d0 100644 --- a/site/assets/scss/_variables.scss +++ b/site/assets/scss/_variables.scss @@ -1,17 +1,15 @@ // stylelint-disable scss/dollar-variable-default // Local docs variables -$bd-purple: #563d7c; +$bd-purple: #4c0bce; $bd-violet: lighten(saturate($bd-purple, 5%), 15%); // stylelint-disable-line function-disallowed-list $bd-purple-light: lighten(saturate($bd-purple, 5%), 45%); // stylelint-disable-line function-disallowed-list $bd-accent: #ffe484; -$bd-info: #5bc0de; -$bd-warning: #f0ad4e; -$bd-danger: #d9534f; $dropdown-active-icon: url("data:image/svg+xml,"); -$sidebar-collapse-icon: url("data:image/svg+xml,"); +$search-clear-icon: url("data:image/svg+xml,"); -$bd-gutter-x: 1.25rem; +$bd-gutter-x: 3rem; +$bd-callout-variants: info, warning, danger !default; :root { --bd-purple: #{$bd-purple}; @@ -19,4 +17,6 @@ $bd-gutter-x: 1.25rem; --bd-accent: #{$bd-accent}; --bd-violet-rgb: #{to-rgb($bd-violet)}; --bd-accent-rgb: #{to-rgb($bd-accent)}; + --bd-pink-rgb: #{to-rgb($pink-500)}; + --bd-teal-rgb: #{to-rgb($teal-500)}; } diff --git a/site/assets/scss/docs.scss b/site/assets/scss/docs.scss index 0029e83af..f1390e2fa 100644 --- a/site/assets/scss/docs.scss +++ b/site/assets/scss/docs.scss @@ -37,7 +37,7 @@ $enable-cssgrid: true; // stylelint-disable-line scss/dollar-variable-default // Load docs components @import "variables"; @import "navbar"; -@import "subnav"; +@import "search"; @import "masthead"; @import "ads"; @import "content"; diff --git a/site/content/docs/5.1/components/offcanvas.md b/site/content/docs/5.1/components/offcanvas.md index 7a8cbc68a..6ad9b6e89 100644 --- a/site/content/docs/5.1/components/offcanvas.md +++ b/site/content/docs/5.1/components/offcanvas.md @@ -137,9 +137,54 @@ When backdrop is set to static, the offcanvas will not close when clicking outsi
{{< /example >}} +## Responsive + +Added in v5.2.0 + +Responsive offcanvas classes hide content outside the viewport from a specified breakpoint and down. Above that breakpoint, the contents within will behave as usual. For example, `.offcanvas-lg` hides content in an offcanvas below the `lg` breakpoint, but shows the content above the `lg` breakpoint. + +
+ + +
Resize your browser to show the responsive offcanvas toggle.
+ +
+
+
Responsive offcanvas
+ +
+
+

This is content within an .offcanvas-lg.

+
+
+
+ +```html + + +
+
+
Responsive offcanvas
+ +
+
+

This is content within an .offcanvas-lg.

+
+
+``` + +Responsive offcanvas classes are available across for each breakpoint. + +- `.offcanvas` +- `.offcanvas-sm` +- `.offcanvas-md` +- `.offcanvas-lg` +- `.offcanvas-xl` +- `.offcanvas-xxl` + ## Placement -There's no default placement for offcanvas components, so you must add one of the modifier classes below; +There's no default placement for offcanvas components, so you must add one of the modifier classes below. - `.offcanvas-start` places offcanvas on the left of the viewport (shown above) - `.offcanvas-end` places offcanvas on the right of the viewport @@ -194,10 +239,18 @@ Try the top, right, and bottom examples out below. Since the offcanvas panel is conceptually a modal dialog, be sure to add `aria-labelledby="..."`—referencing the offcanvas title—to `.offcanvas`. Note that you don’t need to add `role="dialog"` since we already add it via JavaScript. -## Sass +## CSS ### Variables +Added in v5.2.0 + +As part of Bootstrap's evolving CSS variables approach, offcanvas now uses local CSS variables on `.offcanvas` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too. + +{{< scss-docs name="offcanvas-css-vars" file="scss/_offcanvas.scss" >}} + +### Sass variables + {{< scss-docs name="offcanvas-variables" file="scss/_variables.scss" >}} ## Usage diff --git a/site/content/docs/5.1/examples/_index.md b/site/content/docs/5.1/examples/_index.md index 3d5bfab2f..39102f364 100644 --- a/site/content/docs/5.1/examples/_index.md +++ b/site/content/docs/5.1/examples/_index.md @@ -7,30 +7,39 @@ aliases: "/examples/" {{< list-examples.inline >}} {{ range $entry := $.Site.Data.examples -}} -

{{ $entry.category }}

-

{{ $entry.description }}

- {{ if eq $entry.category "RTL" -}} -
-

The RTL feature is still experimental and will probably evolve according to user feedback. Spotted something or have an improvement to suggest? Open an issue, we'd love to get your insights.

-
- {{ end -}} - - {{ range $i, $example := $entry.examples -}} - {{- $len := len $entry.examples -}} - {{ if (eq $i 0) }}
{{ end }} -
- - -

{{ $example.name }}

-
-

{{ $example.description }}

+
+
+

{{ $entry.category }}

+

{{ $entry.description }}

+ {{ if eq $entry.category "RTL" -}} +
+

+ RTL is still experimental and will evolve with feedback. Spotted something or have an improvement to suggest? +

+

Please open an issue.

- {{ if (eq (add $i 1) $len) }}
{{ end }} - {{ end -}} + {{ end -}} +
+ +
+ {{ range $i, $example := $entry.examples -}} + {{- $len := len $entry.examples -}} + {{ if (eq $i 0) }}
{{ end }} +
+ + +

{{ $example.name }}

+
+

{{ $example.description }}

+
+ {{ if (eq (add $i 1) $len) }}
{{ end }} + {{ end -}} +
+
{{ end -}} {{< /list-examples.inline >}} diff --git a/site/content/docs/5.1/examples/navbars-offcanvas/index.html b/site/content/docs/5.1/examples/navbars-offcanvas/index.html new file mode 100644 index 000000000..47041fa01 --- /dev/null +++ b/site/content/docs/5.1/examples/navbars-offcanvas/index.html @@ -0,0 +1,147 @@ +--- +layout: examples +title: Navbar Template +extra_css: + - "navbar.css" +--- + +
+ + + + + + +
+
+
+

Navbar with offcanvas examples

+

This example shows how responsive offcanvas menus work within the navbar. For positioning of navbars, checkout the }}">top and }}">fixed top examples.

+

From the top down, you'll see a dark navbar, light navbar and a responsive navbar—each with offcanvases built in. Resize your browser window to the large breakpoint to see the toggle for the offcanvas.

+

+ }}" role="button">Learn more about offcanvas navbars » +

+
+
+
+
diff --git a/site/content/docs/5.1/examples/navbars-offcanvas/navbar.css b/site/content/docs/5.1/examples/navbars-offcanvas/navbar.css new file mode 100644 index 000000000..70d209409 --- /dev/null +++ b/site/content/docs/5.1/examples/navbars-offcanvas/navbar.css @@ -0,0 +1,7 @@ +body { + padding-bottom: 20px; +} + +.navbar { + margin-bottom: 20px; +} diff --git a/site/content/docs/5.1/utilities/api.md b/site/content/docs/5.1/utilities/api.md index 16270ad51..86cf32938 100644 --- a/site/content/docs/5.1/utilities/api.md +++ b/site/content/docs/5.1/utilities/api.md @@ -11,7 +11,7 @@ Bootstrap utilities are generated with our utility API and can be used to modify The `$utilities` map contains all our utilities and is later merged with your custom `$utilities` map, if present. The utility map contains a keyed list of utility groups which accept the following options: -{{< bs-table "table text-start" >}} +{{< bs-table "table table-utilities" >}} | Option | Type | Default value | Description | | --- | --- | --- | --- | | [`property`](#property) | **Required** | – | Name of the property, this can be a string or an array of strings (e.g., horizontal paddings or margins). | diff --git a/site/content/docs/5.1/utilities/spacing.md b/site/content/docs/5.1/utilities/spacing.md index 70fbe7694..1e5f6d32f 100644 --- a/site/content/docs/5.1/utilities/spacing.md +++ b/site/content/docs/5.1/utilities/spacing.md @@ -10,7 +10,9 @@ toc: true Assign responsive-friendly `margin` or `padding` values to an element or a subset of its sides with shorthand classes. Includes support for individual properties, all properties, and vertical and horizontal properties. Classes are built from a default Sass map ranging from `.25rem` to `3rem`. -Using the CSS Grid layout module? Consider using [the gap utility](#gap). +{{< callout >}} +**Using the CSS Grid layout module?** Consider using [the gap utility](#gap) instead. +{{< /callout >}} ### Notation diff --git a/site/data/examples.yml b/site/data/examples.yml index 6d6419d21..38644ef4a 100644 --- a/site/data/examples.yml +++ b/site/data/examples.yml @@ -63,6 +63,8 @@ examples: - name: Navbars description: "Demonstration of all responsive and container options for the navbar." + - name: Navbars offcanvas + description: "Same as the Navbars example, but with our offcanvas component." - name: Navbar static description: "Single navbar example of a static top navbar along with some additional content." - name: Navbar fixed diff --git a/site/data/plugins.yml b/site/data/plugins.yml new file mode 100644 index 000000000..22cec9877 --- /dev/null +++ b/site/data/plugins.yml @@ -0,0 +1,47 @@ +- name: Alert + description: Show and hide alert messages to your users. + link: components/alerts/#javascript-behavior + +- name: Button + description: Programmatically control the active state for buttons. + link: components/buttons/#button-plugin + +- name: Carousel + description: Add slideshows to any page, including support for crossfade. + link: components/carousel/ + +- name: Collapse + description: Expand and collapse areas of content, or create accordions. + link: components/collapse/ + +- name: Dropdown + description: Create menus of links, actions, forms, and more. + link: components/dropdowns/ + +- name: Modal + description: Add flexible and responsive dialogs to your project. + link: components/modal/ + +- name: Offcanvas + description: Build and toggle hidden sidebars into any page. + link: components/offcanvas/ + +- name: Popover + description: Create custom overlays. Built on Popper.js. + link: components/popovers/ + +- name: Scrollspy + description: Automatically update active nav links based on page scroll. + link: components/scrollspy/ + +- name: Tab + description: Allow Bootstrap nav components to toggle contents. + link: components/navs-tabs/ + +- name: Toast + description: Show and hide notifications to your visitors. + link: components/toasts/ + +- name: Tooltip + description: Replace browser tooltips with custom ones. Built on Popper.js. + link: components/tooltips/ diff --git a/site/data/sidebar.yml b/site/data/sidebar.yml index 8aad6027b..eb03285c5 100644 --- a/site/data/sidebar.yml +++ b/site/data/sidebar.yml @@ -2,6 +2,8 @@ # The logic for the sidebar generation is in "site/layouts/partials/docs-sidebar.html". - title: Getting started + icon: book-half + icon_color: indigo pages: - title: Introduction - title: Download @@ -16,6 +18,8 @@ - title: Contribute - title: Customize + icon: palette2 + icon_color: pink pages: - title: Overview - title: Sass @@ -26,6 +30,8 @@ - title: Optimize - title: Layout + icon: grid-fill + icon_color: teal pages: - title: Breakpoints - title: Containers @@ -37,6 +43,8 @@ - title: CSS Grid - title: Content + icon: file-earmark-richtext + icon_color: gray pages: - title: Reboot - title: Typography @@ -45,6 +53,8 @@ - title: Figures - title: Forms + icon: ui-radios + icon_color: blue pages: - title: Overview - title: Form control @@ -57,6 +67,8 @@ - title: Validation - title: Components + icon: menu-button-wide-fill + icon_color: cyan pages: - title: Accordion - title: Alerts @@ -84,6 +96,8 @@ - title: Tooltips - title: Helpers + icon: magic + icon_color: orange pages: - title: Clearfix - title: Colored links @@ -96,6 +110,8 @@ - title: Vertical rule - title: Utilities + icon: braces-asterisk + icon_color: red pages: - title: API - title: Background @@ -116,11 +132,15 @@ - title: Visibility - title: Extend + icon: tools + icon_color: blue pages: - title: Approach - title: Icons - title: About + icon: globe2 + icon_color: indigo pages: - title: Overview - title: Team diff --git a/site/layouts/_default/baseof.html b/site/layouts/_default/baseof.html index 713ab2864..fdf19b31f 100644 --- a/site/layouts/_default/baseof.html +++ b/site/layouts/_default/baseof.html @@ -5,6 +5,7 @@ {{ block "body_override" . }}{{ end }} {{ partial "skippy" . }} + {{ partial "icons" . }} {{ partial "docs-navbar" . }} diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html index dd063c5dc..3c61cd342 100644 --- a/site/layouts/_default/docs.html +++ b/site/layouts/_default/docs.html @@ -1,29 +1,45 @@ {{ define "main" }} - {{ partial "docs-subnav" . }} - -
+
-
+
- View on GitHub -

{{ .Title | markdownify }}

+ + View on GitHub + +

{{ .Title | markdownify }}

{{ .Page.Params.Description | markdownify }}

{{ partial "ads" . }}
{{ if (eq .Page.Params.toc true) }} -
- On this page - {{ .TableOfContents }} +
+ + On this page +
+
+ {{ .TableOfContents }} +
{{ end }} -
+
{{ if .Page.Params.sections }}
{{ range .Page.Params.sections }} diff --git a/site/layouts/_default/single.html b/site/layouts/_default/single.html index 8ba99c718..ae1a41faa 100644 --- a/site/layouts/_default/single.html +++ b/site/layouts/_default/single.html @@ -1,14 +1,19 @@ {{ define "main" }}
-
+

{{ .Title | markdownify }}

{{ .Page.Params.Description | markdownify }}

{{ if eq .Title "Examples" }} - @@ -20,7 +25,7 @@
-
+
{{ .Content }} {{ if eq .Title "Examples" }} @@ -30,7 +35,7 @@
{{ partial "icons/droplet-fill.svg" (dict "width" "32" "height" "32") }}
-

Go further with Bootstrap Themes

+

Go further with Bootstrap Themes

Need something more than these examples? Take Bootstrap to the next level with premium themes from the official Bootstrap Themes marketplace. They’re built as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools.

diff --git a/site/layouts/partials/docs-navbar.html b/site/layouts/partials/docs-navbar.html index 171a2ad73..441c2bd56 100644 --- a/site/layouts/partials/docs-navbar.html +++ b/site/layouts/partials/docs-navbar.html @@ -1,74 +1,89 @@ -
diff --git a/site/layouts/partials/home/masthead-followup.html b/site/layouts/partials/home/masthead-followup.html index 48f77f470..95f394f5a 100644 --- a/site/layouts/partials/home/masthead-followup.html +++ b/site/layouts/partials/home/masthead-followup.html @@ -1,37 +1,39 @@ -
-
-
-
- {{ partial "icons/code.svg" (dict "width" "32" "height" "32") }} -
-

Installation

-

- Install Bootstrap’s source Sass and JavaScript files via npm, Composer, or Meteor. -

-

Package managed installs don’t include documentation or our full build scripts. You can also use our npm template repo to quickly generate a Bootstrap project via npm.

- Read installation docs -
-
- {{ highlight "npm install bootstrap" "sh" "" }} - {{ highlight (printf ("gem install bootstrap -v %s") .Site.Params.current_ruby_version) "sh" "" }} +
+
+
+
-
+

Get started any way you want

+

+ Jump right into building with Bootstrap—use the CDN, install it via package manager, or download the source code. +

+

+ + Read installation docs + + +

+
-
-
-
- {{ partial "icons/cloud-fill.svg" (dict "width" "32" "height" "32") }} -
-

jsDelivr

-

- When you only need to include Bootstrap’s compiled CSS or JS, you can use jsDelivr. +

+
+ +

Install via package manager

+

+ Install Bootstrap’s source Sass and JavaScript files via npm, RubyGems, Composer, or Meteor. Package managed installs don’t include documentation or our full build scripts. You can also use our npm template repo to quickly generate a Bootstrap project via npm.

+ {{ highlight "npm install bootstrap" "sh" "" }} + {{ highlight (printf ("gem install bootstrap -v %s") .Site.Params.current_ruby_version) "sh" "" }}

- See it in action with our simple starter template, or browse the examples to jumpstart your next project. You can also choose to include Popper and our JS separately. + Read our installation docs for more info and additional package managers.

- Explore the docs
-
+
+ +

Include via CDN

+

+ When you only need to include Bootstrap’s compiled CSS or JS, you can use jsDelivr. See it in action with our simple starter template, or browse the examples to jumpstart your next project. You can also choose to include Popper and our JS separately. +

{{ highlight (printf (` `) .Site.Params.cdn.css (.Site.Params.cdn.css_hash | safeHTMLAttr)) "html" "" }} @@ -41,21 +43,267 @@
-
-
-
+
+
+ +
+

Customize everything with Sass

+

+ Bootstrap utilizes Sass for a modular and customizable architecture. Import only the components you need, enable global options like gradients and shadows, and write your own CSS with our variables, maps, functions, and mixins. +

+

+ + Learn more about customizing + + +

+
+ +
+
+

Include all of Bootstrap’s Sass

+

Import one stylesheet and you're off to the races with every feature of our CSS.

+ {{ highlight (printf `// Variable overrides first +$primary: #900; +$enable-shadows: true; +$variable-prefix: "mo-"; + +// Then import Bootstrap +@import "../node_modules/bootstrap/scss/bootstrap"; +`) "scss" "" }} +

Learn more about our global Sass options.

+
+
+

Include what you need

+

The easiest way to customize Bootstrap—include only the CSS you need.

+{{ highlight (printf `// Functions first +@import "../node_modules/bootstrap/scss/functions"; + +// Variable overrides second +$primary: #900; +$enable-shadows: true; +$variable-prefix: "mo-"; + +// Required Bootstrap imports +@import "../node_modules/bootstrap/scss/variables"; +@import "../node_modules/bootstrap/scss/maps"; +@import "../node_modules/bootstrap/scss/mixins"; +@import "../node_modules/bootstrap/scss/root"; + +// Optional components +@import "../node_modules/bootstrap/scss/utilities"; +@import "../node_modules/bootstrap/scss/reboot"; +@import "../node_modules/bootstrap/scss/containers"; +@import "../node_modules/bootstrap/scss/grid"; +@import "../node_modules/bootstrap/scss/helpers"; +@import "../node_modules/bootstrap/scss/utilities/api"; +`) "scss" "" }} +

Learn more about using Bootstrap with Sass.

+
+
+ +
+
+
+ +
+

Build and extend in real-time with CSS variables

+

+ Bootstrap 5 is evolving with each release to better utilize CSS variables for global theme styles, individual components, and even utilities. We provide dozens of variables for colors, font styles, and more at a :root level for use anywhere. On components and utilities, CSS variables are scoped to the relevant class and can easily be modified. +

+

+ + Learn more about CSS variables + + +

+
+
+
+

Using CSS variables

+

Use any of our global :root variables to write new styles. CSS variables use the var(--bs-variableName) syntax and can be inherited by children elements.

+ {{ highlight (printf `.component { + color: var(--bs-gray-800); + background-color: var(--bs-gray-100); + border: 1px solid var(--bs-gray-200); + border-radius: .25rem; +} + +.component-header { + color: var(--bs-purple); +}`) "scss" "" }} +
+
+

Customizing via CSS variables

+

Override global, component, or utility class variables to customize Bootstrap just how you like. No need to redeclare each rule, just a new variable value.

+ {{ highlight (printf `body { + --bs-body-font-family: var(--bs-font-monospace); + --bs-body-line-height: 1.4; + --bs-body-bg: var(--bs-gray-100); +} + +.table { + --bs-table-color: var(--bs-gray-600); + --bs-table-bg: var(--bs-gray-100); + --bs-table-border-color: transparent; +}`) "scss" "" }} +
+
+
+ +
+
+
+ +
+ +
+ +
+

Components, meet the Utility API

+

+ New in Bootstrap 5, our utilities are now generated by our Utility API. We built it as a feature-packed Sass map that can be quickly and easily customized. It's never been easier to add, remove, or modify any utility classes. Make utilities responsive, add pseudo-class variants, and give them custom names. +

+

+ + Learn more about utilities + + + + Explore customized components + + +

+
+
+
+
Quickly customize components
+
+ + +
+ {{ highlight (printf `// Create and extend utilities with the Utility API + +@import "bootstrap/scss/bootstrap"; + +$utilities: map-merge( + $utilities, + ( + "cursor": ( + property: cursor, + class: cursor, + responsive: true, + values: auto pointer grab, + ) + ) +); +`) "scss" "" }} +
+
+ +
+
+
+ +
+

Powerful JavaScript plugins without jQuery

+

+ Easily add toggleable hidden elements, modals and offcanvas menus, popovers and tooltips, and so much more—all without jQuery. JavaScript in Bootstrap is HTML-first, which means adding plugins is as easy as adding data attributes. Need more control? Include individual plugins programmatically. +

+

+ + Learn more about Bootstrap JavaScript + + +

+
+
+
+

Data attribute API

+

Why write more JavaScript when you can write HTML? Nearly all of Bootstrap's JavaScript plugins feature a first-class data API, allowing you to use JavaScript just by adding data attributes.

+
+ +
+ + {{ highlight (printf ` +`) "html" "" }} +

Learn more about our JavaScript as modules and using the programmatic API.

+
+
+

Comprehensive set of plugins

+

Bootstrap features a dozen plugins that you can drop into any project. Drop them in all at once, or choose just the ones you need.

+
+
+ {{- range $plugin := .Site.Data.plugins -}} + {{- $href := printf "/docs/%s/%s" $.Site.Params.docs_version $plugin.link }} + + {{- end }} +
+
+
+ +
+ +
+
+
{{ partial "icons/circle-square.svg" (dict "width" "32" "height" "32") }}
-

Bootstrap Icons

+

Personalize it with Bootstrap Icons

- For the first time ever, Bootstrap has its own open source SVG icon library, designed to work best with our components and documentation. + Bootstrap Icons is an open source SVG icon library featuring over 1,500 glyphs, with more added every release. They're designed to work in any project, whether you use Bootstrap itself or not. Use them as SVGs or icon fonts—both options give you vector scaling and easy customization via CSS.

-

- Bootstrap Icons are designed to work best with Bootstrap components, but they’ll work in any project. They’re SVGs, so they scale quickly and easily, can be implemented in several ways, and can be styled with CSS. +

+ + Get Bootstrap Icons + +

- Get Bootstrap Icons
-
+
-
-
-
+
+
+
{{ partial "icons/droplet-fill.svg" (dict "width" "32" "height" "32") }}
-

Official Themes

+

Make it yours with official Bootstrap Themes

- Take Bootstrap to the next level with premium themes from the official Bootstrap Themes marketplace. + Take Bootstrap to the next level with premium themes from the official Bootstrap Themes marketplace. Themes are built on Bootstrap as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools.

-

- Themes are built on Bootstrap as their own extended frameworks, rich with new components and plugins, documentation, and powerful build tools. +

+ + Browse Bootstrap Themes + +

- Browse themes
-
+
-
-
-
- {{ partial "icons/homepage-hero.svg" (dict "class" "img-fluid mb-3 mb-md-0" "width" "600" "height" "533") }} -
-
-

Build fast, responsive sites with Bootstrap

-

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

- -
- Get started - Download +
+
+ + New in v5.1 + CSS Grid, offcanvas navbars, improved utilities, and more! + + Bootstrap +

Build fast, responsive sites with Bootstrap

+

+ Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid system and components, and bring projects to life with powerful JavaScript plugins. +

+
+
+ {{ highlight "npm i bootstrap" "sh" "" }}
-

- Currently v{{ .Site.Params.current_version }} - · - v4.6.x docs - · - All releases -

+ + + Read the docs +
+

+ Currently v{{ .Site.Params.current_version }} + · + Download + · + v4.6.x docs + · + All releases +

+ {{ partial "ads" . }}
- {{ partial "ads" . }}
diff --git a/site/layouts/partials/icons.html b/site/layouts/partials/icons.html new file mode 100644 index 000000000..9841e143a --- /dev/null +++ b/site/layouts/partials/icons.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + Check + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html index 2b70521f5..5e2e52e90 100644 --- a/site/layouts/partials/scripts.html +++ b/site/layouts/partials/scripts.html @@ -25,8 +25,7 @@ // Open in StackBlitz logic document.querySelectorAll('.btn-edit').forEach(btn => { btn.addEventListener('click', event => { - const htmlSnippet = event.target.closest('.bd-edit').previousSibling.innerHTML - + const htmlSnippet = event.target.closest('.bd-code-snippet').querySelector('.bd-example').innerHTML StackBlitzSDK.openBootstrapSnippet(htmlSnippet) }) }) diff --git a/site/layouts/shortcodes/example.html b/site/layouts/shortcodes/example.html index a808c2589..9dab2f9d1 100644 --- a/site/layouts/shortcodes/example.html +++ b/site/layouts/shortcodes/example.html @@ -15,17 +15,30 @@ {{- $show_markup := .Get "show_markup" | default true -}} {{- $input := .Inner -}} -{{- if eq $show_preview true -}} - - {{- $input -}} -
-{{- end -}} - -{{- if eq $show_markup true -}} -
- +
+ {{- if eq $show_preview true -}} + + {{- $input -}}
- {{- $content := replaceRE `\n` `...` $input -}} - {{- $content = replaceRE ` (class=" *?")` "" $content -}} - {{- highlight (trim $content "\n") $lang "" -}} -{{- end -}} + {{- end -}} + + {{- if eq $show_markup true -}} + {{- if eq $show_preview true -}} +
+ {{- $lang -}} +
+ + +
+
+ {{- end -}} + + {{- $content := replaceRE `\n` `...` $input -}} + {{- $content = replaceRE ` (class=" *?")` "" $content -}} + {{- highlight (trim $content "\n") $lang "" -}} + {{- end -}} +
diff --git a/site/static/docs/5.1/assets/img/examples/navbars-offcanvas.png b/site/static/docs/5.1/assets/img/examples/navbars-offcanvas.png new file mode 100644 index 000000000..81b000dbf Binary files /dev/null and b/site/static/docs/5.1/assets/img/examples/navbars-offcanvas.png differ diff --git a/site/static/docs/5.1/assets/img/examples/navbars-offcanvas@2x.png b/site/static/docs/5.1/assets/img/examples/navbars-offcanvas@2x.png new file mode 100644 index 000000000..af5313436 Binary files /dev/null and b/site/static/docs/5.1/assets/img/examples/navbars-offcanvas@2x.png differ -- cgit v1.2.3 From 5602093c7be8726f1b1043b3d71bb887d6f1f607 Mon Sep 17 00:00:00 2001 From: Toto Date: Mon, 18 Apr 2022 15:56:13 +0700 Subject: change `.border-right` to `.border-end` --- site/content/docs/5.1/examples/modals/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.1/examples/modals/index.html b/site/content/docs/5.1/examples/modals/index.html index 8043f2b44..0f16aabf8 100644 --- a/site/content/docs/5.1/examples/modals/index.html +++ b/site/content/docs/5.1/examples/modals/index.html @@ -83,7 +83,7 @@ body_class: ""

You can always change your mind in your account settings.

-- cgit v1.2.3 From 3990ff04a00f2768b768e1c852594e3a365b9c61 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 18 Apr 2022 18:05:09 -0700 Subject: Fix spacing of code snippets --- site/assets/scss/_component-examples.scss | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index b305f088f..701682d20 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -85,16 +85,10 @@ .bd-example { position: relative; padding: 1rem; - margin: 1rem ($bd-gutter-x * -.5) 0; - border: solid $border-color; - border-width: 1px 0 0; @include clearfix(); @include media-breakpoint-up(md) { padding: 1.5rem; - margin-right: 0; - margin-left: 0; - border-width: 1px; @include border-top-radius(var(--bs-border-radius)); } @@ -375,23 +369,24 @@ } } -.bd-example-snippet { +.bd-code-snippet { + margin: $spacer ($bd-gutter-x * -.5); + border: solid $border-color; + border-width: 1px 0; + .highlight { - @include border-top-radius(0); - border: 1px solid $border-color; - } - .highlight-toolbar { - border: solid $border-color; - border-width: 0 1px; + margin-bottom: 0; } -} - -.bd-content .highlight { - margin-right: $bd-gutter-x * -.5; - margin-left: $bd-gutter-x * -.5; @include media-breakpoint-up(md) { margin-right: 0; margin-left: 0; + border-width: 1px; + @include border-radius($border-radius); } } + +.highlight-toolbar { + border: solid $border-color; + border-width: 1px 0; +} -- cgit v1.2.3 From 3362c8cf13cc3610a6e0ac1efc673f7f8c74ac08 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 18 Apr 2022 20:56:18 -0700 Subject: Do some CSS and Migration guide cleanup (#36191) * Do some CSS and Migration guide cleanup - More code snippet tweaks - Fix some homepage hero bugs - Do a cleanup on Migration guide content to highlight more changes and fix some issues from merge conflicts --- site/assets/scss/_component-examples.scss | 12 +++++++--- site/assets/scss/_masthead.scss | 6 ++++- site/assets/scss/_syntax.scss | 2 +- site/content/docs/5.1/components/offcanvas.md | 22 ++++-------------- site/content/docs/5.1/migration.md | 32 +++++++++------------------ 5 files changed, 30 insertions(+), 44 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index 701682d20..73ffe2f8e 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -82,6 +82,15 @@ // Docs examples // +.bd-example-snippet { + border: solid $border-color; + border-width: 1px 0; + + @include media-breakpoint-up(md) { + border-width: 1px; + } +} + .bd-example { position: relative; padding: 1rem; @@ -371,8 +380,6 @@ .bd-code-snippet { margin: $spacer ($bd-gutter-x * -.5); - border: solid $border-color; - border-width: 1px 0; .highlight { margin-bottom: 0; @@ -381,7 +388,6 @@ @include media-breakpoint-up(md) { margin-right: 0; margin-left: 0; - border-width: 1px; @include border-radius($border-radius); } } diff --git a/site/assets/scss/_masthead.scss b/site/assets/scss/_masthead.scss index 42ad0f385..4bb356e10 100644 --- a/site/assets/scss/_masthead.scss +++ b/site/assets/scss/_masthead.scss @@ -20,9 +20,13 @@ color: $gray-700; } + .bd-code-snippet { + margin: 0; + @include border-radius(.5rem); + } + .highlight { padding: .5rem 4rem .5rem 1rem; - margin-bottom: 0; line-height: 1.25; background-color: rgba(var(--bs-body-color-rgb), .075); @include border-radius(.5rem); diff --git a/site/assets/scss/_syntax.scss b/site/assets/scss/_syntax.scss index 662f70dc4..487550bfd 100644 --- a/site/assets/scss/_syntax.scss +++ b/site/assets/scss/_syntax.scss @@ -35,7 +35,7 @@ font-weight: 600; color: #fff; } -.gi { color: var(--base0C); } +.gi { color: var(--bs-success); } .gp { font-weight: 600; color: var(--base04); diff --git a/site/content/docs/5.1/components/offcanvas.md b/site/content/docs/5.1/components/offcanvas.md index 6ad9b6e89..3abdc3acf 100644 --- a/site/content/docs/5.1/components/offcanvas.md +++ b/site/content/docs/5.1/components/offcanvas.md @@ -143,24 +143,10 @@ When backdrop is set to static, the offcanvas will not close when clicking outsi Responsive offcanvas classes hide content outside the viewport from a specified breakpoint and down. Above that breakpoint, the contents within will behave as usual. For example, `.offcanvas-lg` hides content in an offcanvas below the `lg` breakpoint, but shows the content above the `lg` breakpoint. -
- - -
Resize your browser to show the responsive offcanvas toggle.
- -
-
-
Responsive offcanvas
- -
-
-

This is content within an .offcanvas-lg.

-
-
-
+{{< example >}} + -```html - +
Resize your browser to show the responsive offcanvas toggle.
@@ -171,7 +157,7 @@ Responsive offcanvas classes hide content outside the viewport from a specified

This is content within an .offcanvas-lg.

-``` +{{< /example >}} Responsive offcanvas classes are available across for each breakpoint. diff --git a/site/content/docs/5.1/migration.md b/site/content/docs/5.1/migration.md index baba2dffa..21b965e56 100644 --- a/site/content/docs/5.1/migration.md +++ b/site/content/docs/5.1/migration.md @@ -17,23 +17,7 @@ Bootstrap v5.2.0 features a subtle design update for a handful of components and ### More CSS variables -**We've updated nearly all our components to use CSS variables.** While Sass still underpins everything, each component has been updated to include CSS variables on the component base classes (e.g., `.btn`), allowing for more real-time customization of Bootstrap. - -The following components are now built with CSS variables: - -- [Alerts]({{< docsref "/components/alerts/" >}}) -- [Badges]({{< docsref "/components/badge/" >}}) -- [Breadcrumbs]({{< docsref "/components/breadcrumb/" >}}) -- [Buttons]({{< docsref "/components/buttons/" >}}) -- [Dropdowns]({{< docsref "/components/dropdowns/" >}}) -- [Navbars]({{< docsref "/components/navbar/" >}}) -- [Pagination]({{< docsref "/components/pagination/" >}}) -- [Popovers]({{< docsref "/components/popovers/" >}}) -- [Progress]({{< docsref "/components/progress/" >}}) -- [Spinners]({{< docsref "/components/spinners/" >}}) -- [Tooltips]({{< docsref "/components/tooltips/" >}}) - -Read more about CSS variables in each component on their respective documentation pages. The rest of our components, forms, and more will be updated by v5.3. +**We've updated all our components to use CSS variables.** While Sass still underpins everything, each component has been updated to include CSS variables on the component base classes (e.g., `.btn`), allowing for more real-time customization of Bootstrap. In subsequent releases, we'll continue to expand our use of CSS variables into our layout, forms, helpers, and utilities. Read more about CSS variables in each component on their respective documentation pages. Our CSS variable usage will be somewhat incomplete until Bootstrap 6. While we'd love to fully implement these across the board, they do run the risk of causing breaking changes. For example, setting `$alert-border-width: var(--bs-border-width)` in our source code breaks potential Sass in your own code if you were doing `$alert-border-width * 2` for some reason. @@ -43,7 +27,7 @@ As such, wherever possible, we will continue to push towards more CSS variables, **Bootstrap v5.2.0 introduced a new Sass file with `_maps.scss`.** It pulls out several Sass maps from `_variables.scss` to fix an issue where updates to an original map were not applied to secondary maps that extend them. For example, updates to `$theme-colors` were not being applied to other theme maps that relied on `$theme-colors`, breaking key customization workflows. In short, Sass has a limitation where once a default variable or map has been _used_, it cannot be updated. _There's a similar shortcoming with CSS variables when they're used to compose other CSS variables._ -This is why variable customizations in Bootstrap have to come after `@import "functions"`, but before `@import "variables"` and the rest of our import stack. The same applies to Sass maps—you must override the defaults before the defaults get used. The following maps have been moved to the new `_maps.scss`: +This is why variable customizations in Bootstrap have to come after `@import "functions"`, but before `@import "variables"` and the rest of our import stack. The same applies to Sass maps—you must override the defaults before they get used. The following maps have been moved to the new `_maps.scss`: - `$theme-colors-rgb` - `$utilities-colors` @@ -92,11 +76,19 @@ Your custom Bootstrap CSS builds should now look something like this with a sepa - **Introduced new `$enable-container-classes` option. —** Now when opting into the experimental CSS Grid layout, `.container-*` classes will still be compiled, unless this option is set to `false`. Containers also now keep their gutter values. +- **Offcanvas component now has [responsive variations]({{< docsref "/components/offcanvas#responsive" >}}).** The original `.offcanvas` class remains unchanged—it hides content across all viewports. To make it responsive, change that `.offcanvas` class to any `.offcanvas-{sm|md|lg|xl|xxl}` class. + - **Thicker table dividers are now opt-in. —** We've removed the thicker and more difficult to override border between table groups and moved it to an optional class you can apply, `.table-group-divider`. [See the table docs for an example.]({{< docsref "/content/tables#table-group-dividers" >}}) +- **[Scrollspy has been rewritten](https://github.com/twbs/bootstrap/pull/33421) to use the Intersection Observer API**, which means you no longer need relative parent wrappers, deprecates `offset` config, and more. Look for your Scrollspy implementations to be more accurate and consistent in their nav highlighting. + +- **Popovers and tooltips now use CSS variables.** Some CSS variables have been updated from their Sass counterparts to reduce the number of variables. As a result, three variables have been deprecated in this release: `$popover-arrow-color`, `$popover-arrow-outer-color`, and `$tooltip-arrow-color`. + - Added `.form-check-reverse` modifier to flip the order of labels and associated checkboxes/radios. -- Added striped columns support to tables via +- Added [striped columns]({{< docsref "/content/tables#striped-columns" >}}) support to tables via the new `.table-striped-columns` class. + +For a complete list of changes, [see the v5.2.0 project on GitHub](https://github.com/twbs/bootstrap/projects/32). ## v5.1.0 @@ -128,8 +120,6 @@ Want more information? [Read the v5.1.0 blog post.](https://blog.getbootstrap.co **Hey there!** Changes to our first major release of Bootstrap 5, v5.0.0, are documented below. They don't reflect the additional changes shown above. {{< /callout >}} -- **Popovers and tooltips now use CSS variables.** Both components have been updated to use CSS variables on their base classes, `.popover` and `.tooltip`. Some CSS variables have been updated from their Sass counterparts to reduce the number of variables. As a result, three variables have been deprecated in this release: `$popover-arrow-color`, `$popover-arrow-outer-color`, and `$tooltip-arrow-color`. - ## Dependencies - Dropped jQuery. -- cgit v1.2.3 From 2aad1696f1536202b1d66205f7f9889b3b311755 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 18 Apr 2022 21:41:58 -0700 Subject: One more code snippet fix --- site/assets/scss/_component-examples.scss | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'site') diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index 73ffe2f8e..75d4e96cd 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -94,13 +94,25 @@ .bd-example { position: relative; padding: 1rem; + margin: 0 ($bd-gutter-x * -.5); + border: solid $border-color; + border-width: 1px 0 0; @include clearfix(); @include media-breakpoint-up(md) { padding: 1.5rem; + margin-right: 0; + margin-left: 0; + border-width: 1px; @include border-top-radius(var(--bs-border-radius)); } + + .bd-code-snippet { + @include border-top-radius(0); + border: solid $border-color; + border-width: 0 1px 1px; + } + + p { margin-top: 2rem; } @@ -379,12 +391,16 @@ } .bd-code-snippet { - margin: $spacer ($bd-gutter-x * -.5); + margin: 0 ($bd-gutter-x * -.5) $spacer; .highlight { margin-bottom: 0; } + .bd-example { + border: 0; + } + @include media-breakpoint-up(md) { margin-right: 0; margin-left: 0; -- cgit v1.2.3 From 9ec51f449904bae076b2334e748559706182f046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Tue, 19 Apr 2022 08:14:40 +0200 Subject: Realign Cheatsheet nav tabs example rendering with the examples in the doc --- site/content/docs/5.1/examples/cheatsheet/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.1/examples/cheatsheet/index.html b/site/content/docs/5.1/examples/cheatsheet/index.html index 580e084df..c3c76fae0 100644 --- a/site/content/docs/5.1/examples/cheatsheet/index.html +++ b/site/content/docs/5.1/examples/cheatsheet/index.html @@ -1174,13 +1174,13 @@ body_class: "bg-light" {{< /example >}} -- cgit v1.2.3 From e089aef00fef68c6a815327d8b988e14cfcf4d9b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 19 Apr 2022 11:21:43 -0700 Subject: Refactor some docs examples CSS (#36194) * Fix some more borders and margins * Flex utilities docs: remove .bd-highlight class from snippets * Explicit close target * Reorder to keep base class up top * Fix custom position example * Tooltips: add code snippet, use scss-docs ref for custom tooltip * Tweak text for pagination examples * Modals: move custom styles to utilities * Grid docs: Combine selectors and share coloring * Refactor tons of little things --- site/assets/scss/_component-examples.scss | 190 ++++----- site/content/docs/5.1/components/modal.md | 4 +- site/content/docs/5.1/components/offcanvas.md | 2 +- site/content/docs/5.1/components/pagination.md | 4 +- site/content/docs/5.1/components/tooltips.md | 15 +- site/content/docs/5.1/layout/css-grid.md | 30 +- site/content/docs/5.1/utilities/flex.md | 546 ++++++++++++------------- site/content/docs/5.1/utilities/position.md | 2 +- 8 files changed, 378 insertions(+), 415 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss index 75d4e96cd..d48154a86 100644 --- a/site/assets/scss/_component-examples.scss +++ b/site/assets/scss/_component-examples.scss @@ -1,83 +1,3 @@ -// -// Grid examples -// - -.bd-example-row { - .row { - > .col, - > [class^="col-"] { - padding-top: .75rem; - padding-bottom: .75rem; - background-color: rgba(39, 41, 43, .03); - border: 1px solid rgba(39, 41, 43, .1); - } - } - - .row + .row { - margin-top: 1rem; - } -} - -.bd-example-row-flex-cols .row { - min-height: 10rem; - background-color: rgba(255, 0, 0, .1); -} - -.bd-example-cssgrid { - text-align: center; - - .grid + .grid { - margin-top: 1rem; - } - - .grid > * { - padding-top: .75rem; - padding-bottom: .75rem; - background-color: rgba(255, 0, 255, .1); - border: 1px solid rgba(255, 0, 255, .25); - } -} - -.bd-highlight { - background-color: rgba($bd-purple, .15); - border: 1px solid rgba($bd-purple, .15); -} - -// Grid mixins -.example-container { - width: 800px; - @include make-container(); -} - -.example-row { - @include make-row(); -} - -.example-content-main { - @include make-col-ready(); - - @include media-breakpoint-up(sm) { - @include make-col(6); - } - - @include media-breakpoint-up(lg) { - @include make-col(8); - } -} - -.example-content-secondary { - @include make-col-ready(); - - @include media-breakpoint-up(sm) { - @include make-col(6); - } - - @include media-breakpoint-up(lg) { - @include make-col(4); - } -} - - // // Docs examples // @@ -92,15 +12,18 @@ } .bd-example { + --bd-example-padding: 1rem; + position: relative; - padding: 1rem; + padding: var(--bd-example-padding); margin: 0 ($bd-gutter-x * -.5); border: solid $border-color; - border-width: 1px 0 0; + border-width: 1px 0; @include clearfix(); @include media-breakpoint-up(md) { - padding: 1.5rem; + --bd-example-padding: 1.5rem; + margin-right: 0; margin-left: 0; border-width: 1px; @@ -127,7 +50,7 @@ > .alert + .alert, > .navbar + .navbar, > .progress + .progress { - margin-top: 1rem; + margin-top: $spacer; } > .dropdown-menu { @@ -171,30 +94,80 @@ .fixed-top, .sticky-top { position: static; - margin: -1rem -1rem 1rem; + margin: calc(var(--bd-example-padding) * -1) calc(var(--bd-example-padding) * -1) var(--bd-example-padding); // stylelint-disable-line function-disallowed-list } .fixed-bottom, .sticky-bottom { position: static; - margin: 1rem -1rem -1rem; - } + margin: var(--bd-example-padding) calc(var(--bd-example-padding) * -1) calc(var(--bd-example-padding) * -1); // stylelint-disable-line function-disallowed-list - @include media-breakpoint-up(sm) { - .fixed-top, - .sticky-top { - margin: -1.5rem -1.5rem 1rem; - } - .fixed-bottom, - .sticky-bottom { - margin: 1rem -1.5rem -1.5rem; - } } // Pagination .pagination { - margin-top: .5rem; - margin-bottom: .5rem; + margin-bottom: 0; + } +} + +// +// Grid examples +// + +.bd-example-row [class^="col"], +.bd-example-cssgrid .grid > * { + padding-top: .75rem; + padding-bottom: .75rem; + background-color: rgba(var(--bd-violet-rgb), .1); + border: 1px solid rgba(var(--bd-violet-rgb), .25); +} + +.bd-example-row .row + .row, +.bd-example-cssgrid .grid + .grid { + margin-top: 1rem; +} + +.bd-example-row-flex-cols .row { + min-height: 10rem; + background-color: rgba(255, 0, 0, .1); +} + +.bd-example-flex div { + background-color: rgba($bd-purple, .15); + border: 1px solid rgba($bd-purple, .15); +} + +// Grid mixins +.example-container { + width: 800px; + @include make-container(); +} + +.example-row { + @include make-row(); +} + +.example-content-main { + @include make-col-ready(); + + @include media-breakpoint-up(sm) { + @include make-col(6); + } + + @include media-breakpoint-up(lg) { + @include make-col(8); + } +} + +.example-content-secondary { + @include make-col-ready(); + + @include media-breakpoint-up(sm) { + @include make-col(6); + } + + @include media-breakpoint-up(lg) { + @include make-col(4); } } @@ -224,18 +197,7 @@ } } -.bd-example-modal { - background-color: #fafafa; - - .modal { - position: static; - display: block; - } -} - .bd-example-offcanvas { - @include border-start-radius(0); - .offcanvas { position: static; display: block; @@ -250,9 +212,11 @@ white-space: nowrap; } +// scss-docs-start custom-tooltip .custom-tooltip { --bs-tooltip-bg: var(--bs-primary); } +// scss-docs-end custom-tooltip // scss-docs-start custom-popovers .custom-popover { @@ -290,7 +254,6 @@ .active { background-color: rgba($bd-purple, .15); } - } .bd-example-border-utils { @@ -317,7 +280,7 @@ .bd-example-position-utils { position: relative; - padding: 3em; + padding: 2rem; .position-relative { height: 200px; @@ -325,8 +288,8 @@ } .position-absolute { - width: 2em; - height: 2em; + width: 2rem; + height: 2rem; background-color: $dark; @include border-radius(); } @@ -398,6 +361,7 @@ } .bd-example { + margin: 0; border: 0; } diff --git a/site/content/docs/5.1/components/modal.md b/site/content/docs/5.1/components/modal.md index a33f7e615..d9bd120d4 100644 --- a/site/content/docs/5.1/components/modal.md +++ b/site/content/docs/5.1/components/modal.md @@ -38,8 +38,8 @@ Keep reading for demos and usage guidelines. Below is a _static_ modal example (meaning its `position` and `display` have been overridden). Included are the modal header, modal body (required for `padding`), and modal footer (optional). We ask that you include modal headers with dismiss actions whenever possible, or provide another explicit dismiss action. -
-
diff --git a/site/static/docs/5.2/assets/img/parcel.png b/site/static/docs/5.2/assets/img/parcel.png new file mode 100644 index 000000000..899b29c7b Binary files /dev/null and b/site/static/docs/5.2/assets/img/parcel.png differ diff --git a/site/static/docs/5.2/assets/img/vite.png b/site/static/docs/5.2/assets/img/vite.png new file mode 100644 index 000000000..87b844b6c Binary files /dev/null and b/site/static/docs/5.2/assets/img/vite.png differ diff --git a/site/static/docs/5.2/assets/img/webpack.png b/site/static/docs/5.2/assets/img/webpack.png new file mode 100644 index 000000000..ed1719b81 Binary files /dev/null and b/site/static/docs/5.2/assets/img/webpack.png differ -- cgit v1.2.3 From 9d5c834f946b94683fb567d30e3b88832f213e59 Mon Sep 17 00:00:00 2001 From: Nils K <24257556+septatrix@users.noreply.github.com> Date: Sun, 17 Jul 2022 16:53:15 +0200 Subject: Fix indentation in code sample --- site/content/docs/5.2/components/toasts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.2/components/toasts.md b/site/content/docs/5.2/components/toasts.md index 63fa3174e..562fbf28a 100644 --- a/site/content/docs/5.2/components/toasts.md +++ b/site/content/docs/5.2/components/toasts.md @@ -157,8 +157,8 @@ Customize your toasts by removing sub-components, tweaking them with [utilities]
-- cgit v1.2.3 From eae51cdf324e72049c5dfd9d24e2ac5eb227f82b Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Mon, 18 Jul 2022 09:30:35 +0200 Subject: Fix various small typos in documentation (#36762) --- site/content/docs/5.2/about/translations.md | 2 +- site/content/docs/5.2/content/reboot.md | 2 +- site/content/docs/5.2/customize/css-variables.md | 2 +- site/content/docs/5.2/extend/approach.md | 2 +- site/content/docs/5.2/getting-started/contribute.md | 2 +- site/content/docs/5.2/getting-started/parcel.md | 4 ++-- site/content/docs/5.2/getting-started/rtl.md | 2 +- site/content/docs/5.2/getting-started/vite.md | 2 +- site/content/docs/5.2/getting-started/webpack.md | 4 ++-- site/content/docs/5.2/layout/columns.md | 2 +- site/content/docs/5.2/layout/grid.md | 4 ++-- site/layouts/shortcodes/example.html | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.2/about/translations.md b/site/content/docs/5.2/about/translations.md index e719e3a84..5e2ae30c5 100644 --- a/site/content/docs/5.2/about/translations.md +++ b/site/content/docs/5.2/about/translations.md @@ -5,7 +5,7 @@ description: Links to community-translated Bootstrap documentation sites. group: about --- -Community members have translated Bootstrap's documentation into various languages. None are officially supported and they may not always be up to date. +Community members have translated Bootstrap's documentation into various languages. None are officially supported and they may not always be up-to-date. {{< translations.inline >}}
-- cgit v1.2.3 From 29332a954f86671d39f60007fb0c2ea633731e88 Mon Sep 17 00:00:00 2001 From: Louis-Maxime Piton Date: Wed, 31 Aug 2022 15:50:54 +0200 Subject: Docs: Fix js options to what is really inside js (#37019) --- site/content/docs/5.2/components/collapse.md | 2 +- site/content/docs/5.2/components/dropdowns.md | 6 +++--- site/content/docs/5.2/components/scrollspy.md | 4 ++-- site/content/docs/5.2/components/tooltips.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.2/components/collapse.md b/site/content/docs/5.2/components/collapse.md index 8d775e95d..781998aaf 100644 --- a/site/content/docs/5.2/components/collapse.md +++ b/site/content/docs/5.2/components/collapse.md @@ -146,7 +146,7 @@ const collapseList = [...collapseElementList].map(collapseEl => new bootstrap.Co {{< bs-table "table" >}} | Name | Type | Default | Description | | --- | --- | --- | --- | -`parent` | selector, jQuery object, DOM element | `false` | If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the `card` class). The attribute has to be set on the target collapsible area. | +`parent` | selector, DOM element | `null` | If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the `card` class). The attribute has to be set on the target collapsible area. | `toggle` | boolean | `true` | Toggles the collapsible element on invocation | {{< /bs-table >}} diff --git a/site/content/docs/5.2/components/dropdowns.md b/site/content/docs/5.2/components/dropdowns.md index ec7e584b5..d654e1898 100644 --- a/site/content/docs/5.2/components/dropdowns.md +++ b/site/content/docs/5.2/components/dropdowns.md @@ -1070,11 +1070,11 @@ Regardless of whether you call your dropdown via JavaScript or instead use the d | Name | Type | Default | Description | | --- | --- | --- | --- | | `autoClose` | boolean, string | `true` | Configure the auto close behavior of the dropdown:
  • `true` - the dropdown will be closed by clicking outside or inside the dropdown menu.
  • `false` - the dropdown will be closed by clicking the toggle button and manually calling `hide` or `toggle` method. (Also will not be closed by pressing esc key)
  • `'inside'` - the dropdown will be closed (only) by clicking inside the dropdown menu.
  • `'outside'` - the dropdown will be closed (only) by clicking outside the dropdown menu.
Note: the dropdown can always be closed with the ESC key | -| `boundary` | string, element | `'scrollParent'` | Overflow constraint boundary of the dropdown menu (applies only to Popper's preventOverflow modifier). By default it's `clippingParents` and can accept an HTMLElement reference (via JavaScript only). For more information refer to Popper's [detectOverflow docs](https://popper.js.org/docs/v2/utils/detect-overflow/#boundary). | +| `boundary` | string, element | `'clippingParents'` | Overflow constraint boundary of the dropdown menu (applies only to Popper's preventOverflow modifier). By default it's `clippingParents` and can accept an HTMLElement reference (via JavaScript only). For more information refer to Popper's [detectOverflow docs](https://popper.js.org/docs/v2/utils/detect-overflow/#boundary). | | `display` | string | `'dynamic'` | By default, we use Popper for dynamic positioning. Disable this with `static`. | -| `offset` | number, string, function | `[0, 2]` | Offset of the dropdown relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | +| `offset` | array, string, function | `[0, 2]` | Offset of the dropdown relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | | `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper. | -| `reference` | string, element | `'toggle'` | Reference element of the dropdown menu. Accepts the values of `'toggle'`, `'parent'`, an HTMLElement reference or an object providing `getBoundingClientRect`. For more information refer to Popper's [constructor docs](https://popper.js.org/docs/v2/constructors/#createpopper) and [virtual element docs](https://popper.js.org/docs/v2/virtual-elements/). | +| `reference` | string, element, object | `'toggle'` | Reference element of the dropdown menu. Accepts the values of `'toggle'`, `'parent'`, an HTMLElement reference or an object providing `getBoundingClientRect`. For more information refer to Popper's [constructor docs](https://popper.js.org/docs/v2/constructors/#createpopper) and [virtual element docs](https://popper.js.org/docs/v2/virtual-elements/). | {{< /bs-table >}} #### Using function with `popperConfig` diff --git a/site/content/docs/5.2/components/scrollspy.md b/site/content/docs/5.2/components/scrollspy.md index b2461f0da..7c5985eee 100644 --- a/site/content/docs/5.2/components/scrollspy.md +++ b/site/content/docs/5.2/components/scrollspy.md @@ -377,9 +377,9 @@ const scrollSpy = new bootstrap.ScrollSpy(document.body, { {{< bs-table "table" >}} | Name | Type | Default | Description | | --- | --- | --- | --- | -| `rootMargin` | string | `0px 0px -40%` | Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin) valid units, when calculating scroll position. | +| `rootMargin` | string | `0px 0px -25%` | Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin) valid units, when calculating scroll position. | | `smoothScroll` | boolean | `false` | Enables smooth scrolling when a user clicks on a link that refers to ScrollSpy observables. | -| `target` | string \| jQuery object \| DOM element | | Specifies element to apply Scrollspy plugin. | +| `target` | string, DOM element | `null` | Specifies element to apply Scrollspy plugin. | | `threshold` | array | `[0.1, 0.5, 1]` | `IntersectionObserver` [threshold](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#threshold) valid input, when calculating scroll position.| {{< /bs-table >}} diff --git a/site/content/docs/5.2/components/tooltips.md b/site/content/docs/5.2/components/tooltips.md index 9f1bbdc8d..dcea9601f 100644 --- a/site/content/docs/5.2/components/tooltips.md +++ b/site/content/docs/5.2/components/tooltips.md @@ -212,9 +212,9 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt | `container` | string, element, false | `false` | Appends the tooltip to a specific element. Example: `container: 'body'`. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize. | | `customClass` | string, function | `''` | Add classes to the tooltip when it is shown. Note that these classes will be added in addition to any classes specified in the template. To add multiple classes, separate them with spaces: `'class-1 class-2'`. You can also pass a function that should return a single string containing additional class names. | | `delay` | number, object | `0` | Delay showing and hiding the tooltip (ms)—doesn't apply to manual trigger type. If a number is supplied, delay is applied to both hide/show. Object structure is: `delay: { "show": 500, "hide": 100 }`. | -| `fallbackPlacements` | string, array | `['top', 'right', 'bottom', 'left']` | Define fallback placements by providing a list of placements in array (in order of preference). For more information refer to Popper's [behavior docs](https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements). | +| `fallbackPlacements` | array | `['top', 'right', 'bottom', 'left']` | Define fallback placements by providing a list of placements in array (in order of preference). For more information refer to Popper's [behavior docs](https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements). | | `html` | boolean | `false` | Allow HTML in the tooltip. If true, HTML tags in the tooltip's `title` will be rendered in the tooltip. If false, `innerText` property will be used to insert content into the DOM. Use text if you're worried about XSS attacks. | -| `offset` | number, string, function | `[0, 0]` | Offset of the tooltip relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | +| `offset` | array, string, function | `[0, 0]` | Offset of the tooltip relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | | `placement` | string, function | `'top'` | How to position the tooltip: auto, top, bottom, left, right. When `auto` is specified, it will dynamically reorient the tooltip. When a function is used to determine the placement, it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second. The `this` context is set to the tooltip instance. | | `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper.| | `sanitize` | boolean | `true` | Enable or disable the sanitization. If activated `'template'`, `'content'` and `'title'` options will be sanitized. | -- cgit v1.2.3 From 15318674fb086214e095c61af780a7d889f0f11e Mon Sep 17 00:00:00 2001 From: louismaximepiton Date: Tue, 30 Aug 2022 17:20:59 +0200 Subject: Change offcanvas to be more consistent with carousel and dropdown --- site/content/docs/5.2/components/offcanvas.md | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.2/components/offcanvas.md b/site/content/docs/5.2/components/offcanvas.md index a7384f978..c83e88716 100644 --- a/site/content/docs/5.2/components/offcanvas.md +++ b/site/content/docs/5.2/components/offcanvas.md @@ -79,24 +79,6 @@ You can use a link with the `href` attribute, or a button with the `data-bs-targ
{{< /example >}} -### Dark offcanvas - -{{< added-in "5.2.0" >}} - -Change the appearance of offcanvases with utilities to better match them to different contexts like dark navbars. Here we add `.text-bg-dark` to the `.offcanvas` and `.btn-close-white` to `.btn-close` for proper styling with a dark offcanvas. If you have dropdowns within, consider also adding `.dropdown-menu-dark` to `.dropdown-menu`. - -{{< example class="bd-example-offcanvas p-0 bg-light overflow-hidden" >}} -
-
-
Offcanvas
- -
-
-

Place offcanvas content here.

-
-
-{{< /example >}} - ### Body scrolling Scrolling the `` element is disabled when an offcanvas and its backdrop are visible. Use the `data-bs-scroll` attribute to enable `` scrolling. @@ -155,6 +137,24 @@ When backdrop is set to static, the offcanvas will not close when clicking outsi
{{< /example >}} +## Dark offcanvas + +{{< added-in "5.2.0" >}} + +Change the appearance of offcanvases with utilities to better match them to different contexts like dark navbars. Here we add `.text-bg-dark` to the `.offcanvas` and `.btn-close-white` to `.btn-close` for proper styling with a dark offcanvas. If you have dropdowns within, consider also adding `.dropdown-menu-dark` to `.dropdown-menu`. + +{{< example class="bd-example-offcanvas p-0 bg-light overflow-hidden" >}} +
+
+
Offcanvas
+ +
+
+

Place offcanvas content here.

+
+
+{{< /example >}} + ## Responsive {{< added-in "5.2.0" >}} -- cgit v1.2.3 From 995df354f260ccf46672e4dc9e7b2c242bd4c02d Mon Sep 17 00:00:00 2001 From: louismaximepiton Date: Thu, 25 Aug 2022 14:38:04 +0200 Subject: Set cursor to auto instead of pointer on `.DocSearch-Container` --- site/assets/scss/_search.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'site') diff --git a/site/assets/scss/_search.scss b/site/assets/scss/_search.scss index bce04c9d2..a7e26331f 100644 --- a/site/assets/scss/_search.scss +++ b/site/assets/scss/_search.scss @@ -23,6 +23,7 @@ --docsearch-hit-shadow: none; z-index: 2000; // Make sure to be over all components showcased in the documentation + cursor: auto; @include media-breakpoint-up(lg) { padding-top: 4rem; -- cgit v1.2.3 From 4cea8b1786ddbe365747cabebe9bee44d70a3b6d Mon Sep 17 00:00:00 2001 From: louismaximepiton Date: Fri, 26 Aug 2022 09:19:33 +0200 Subject: Add a comment for track the bug. --- site/assets/scss/_search.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/assets/scss/_search.scss b/site/assets/scss/_search.scss index a7e26331f..01e9d036e 100644 --- a/site/assets/scss/_search.scss +++ b/site/assets/scss/_search.scss @@ -23,7 +23,7 @@ --docsearch-hit-shadow: none; z-index: 2000; // Make sure to be over all components showcased in the documentation - cursor: auto; + cursor: auto; // Needed because of [role="button"] in Algolia search modal. Remove once https://github.com/algolia/docsearch/issues/1370 is tackled. @include media-breakpoint-up(lg) { padding-top: 4rem; -- cgit v1.2.3 From 465cc2da4f028c36f6b1dc7887776af0db4f9176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Mon, 29 Aug 2022 14:34:22 +0200 Subject: Docs: improve cards image overlays markup --- site/content/docs/5.2/components/card.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.2/components/card.md b/site/content/docs/5.2/components/card.md index 78c7cd3f3..6bc90e7b8 100644 --- a/site/content/docs/5.2/components/card.md +++ b/site/content/docs/5.2/components/card.md @@ -381,7 +381,7 @@ Turn an image into a card background and overlay your card's text. Depending on
Card title

This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

-

Last updated 3 mins ago

+

Last updated 3 mins ago

{{< /example >}} -- cgit v1.2.3 From a138bc3fb9ff3495a8d63d776e0ad21ed2aaa1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Fri, 26 Aug 2022 15:27:23 +0200 Subject: More consistency for CSS/Sass vars doc for components with dark variants --- site/content/docs/5.2/components/carousel.md | 6 ++++++ site/content/docs/5.2/components/navbar.md | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.2/components/carousel.md b/site/content/docs/5.2/components/carousel.md index ec9aa466c..327916b2c 100644 --- a/site/content/docs/5.2/components/carousel.md +++ b/site/content/docs/5.2/components/carousel.md @@ -287,8 +287,14 @@ The transition duration of `.carousel-item` can be changed with the `$carousel-t ### Variables +Variables for all carousels: + {{< scss-docs name="carousel-variables" file="scss/_variables.scss" >}} +Variables for the [dark carousel](#dark-variant): + +{{< scss-docs name="carousel-dark-variables" file="scss/_variables.scss" >}} + ## Usage ### Via data attributes diff --git a/site/content/docs/5.2/components/navbar.md b/site/content/docs/5.2/components/navbar.md index bc4792a67..b37db0f92 100644 --- a/site/content/docs/5.2/components/navbar.md +++ b/site/content/docs/5.2/components/navbar.md @@ -792,11 +792,19 @@ Some additional CSS variables are also present on `.navbar-nav`: {{< scss-docs name="navbar-nav-css-vars" file="scss/_navbar.scss" >}} +Customization through CSS variables can be seen on the `.navbar-dark` class where we override specific values without adding duplicate CSS selectors. + +{{< scss-docs name="navbar-dark-css-vars" file="scss/_navbar.scss" >}} + ### Sass variables +Variables for all navbars: + {{< scss-docs name="navbar-variables" file="scss/_variables.scss" >}} -{{< scss-docs name="navbar-theme-variables" file="scss/_variables.scss" >}} +Variables for the [dark navbar](#color-schemes): + +{{< scss-docs name="navbar-dark-variables" file="scss/_variables.scss" >}} ### Sass loop -- cgit v1.2.3 From 87aaf9499620c9a7b592711a6e8d86e9a30467b6 Mon Sep 17 00:00:00 2001 From: Florian Lacreuse Date: Thu, 1 Sep 2022 03:19:45 +0200 Subject: Add default select example in cheatsheet (#36877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julien Déramond --- site/content/docs/5.2/examples/cheatsheet-rtl/index.html | 11 ++++++++++- site/content/docs/5.2/examples/cheatsheet/index.html | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.2/examples/cheatsheet-rtl/index.html b/site/content/docs/5.2/examples/cheatsheet-rtl/index.html index 77accc976..fae87929b 100644 --- a/site/content/docs/5.2/examples/cheatsheet-rtl/index.html +++ b/site/content/docs/5.2/examples/cheatsheet-rtl/index.html @@ -339,6 +339,15 @@ direction: rtl
+
+ + +
@@ -440,7 +449,7 @@ direction: rtl
- diff --git a/site/content/docs/5.2/examples/cheatsheet/index.html b/site/content/docs/5.2/examples/cheatsheet/index.html index 5627f8375..da6c381e4 100644 --- a/site/content/docs/5.2/examples/cheatsheet/index.html +++ b/site/content/docs/5.2/examples/cheatsheet/index.html @@ -338,6 +338,15 @@ body_class: "bg-light"
+
+ + +
@@ -439,7 +448,7 @@ body_class: "bg-light"
- -- cgit v1.2.3 From cda901f2444d6b09cfa3261c84ef98288e3b9834 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Thu, 1 Sep 2022 02:30:23 +0100 Subject: v5/docs: reintroduce `outline` for docs code samples, buttons when `:not(:focus-visible)` (#36507) * Remove outline suppression for focused `
`

Sighted keyboard users rely on knowing where their focus is. If the `
` receives focus (so that it can be scrolled by keyboard users, for instance) then it's essential that they know this is the case

* Only suppress outline for buttons when `:not(:focus-visible)`

* Add right-hand margin to pre

avoids having the focus outline awkwardly clipped by the copy button
---
 site/assets/scss/_component-examples.scss | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

(limited to 'site')

diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss
index 6f3256894..f4865daf8 100644
--- a/site/assets/scss/_component-examples.scss
+++ b/site/assets/scss/_component-examples.scss
@@ -320,15 +320,11 @@
   pre {
     padding: 0;
     margin-top: .625rem;
+    margin-right: 1.875rem;
     margin-bottom: .625rem;
     white-space: pre;
     background-color: transparent;
     border: 0;
-
-    // Undo tabindex that's automatically added by Hugo
-    &:focus {
-      outline: 0;
-    }
   }
 
   pre code {
-- 
cgit v1.2.3


From a12453a0ffe38af0e273e559ec4ced396d39feba Mon Sep 17 00:00:00 2001
From: Mark Otto 
Date: Wed, 31 Aug 2022 20:11:42 -0700
Subject: Fix padding on starter template

---
 site/content/docs/5.2/examples/starter-template/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'site')

diff --git a/site/content/docs/5.2/examples/starter-template/index.html b/site/content/docs/5.2/examples/starter-template/index.html
index a16984ab9..5a898a44d 100644
--- a/site/content/docs/5.2/examples/starter-template/index.html
+++ b/site/content/docs/5.2/examples/starter-template/index.html
@@ -5,7 +5,7 @@ extra_css:
   - "starter-template.css"
 ---
 
-
+
Bootstrap -- cgit v1.2.3 From 77e17e3b8deb4d5467203f4e3cd903b7cd06bde4 Mon Sep 17 00:00:00 2001 From: louismaximepiton Date: Mon, 29 Aug 2022 14:11:13 +0200 Subject: Fix --- site/content/docs/5.2/components/buttons.md | 4 ++-- site/content/docs/5.2/components/carousel.md | 6 +++--- site/content/docs/5.2/components/collapse.md | 6 +++--- site/content/docs/5.2/components/dropdowns.md | 6 +++--- site/content/docs/5.2/components/list-group.md | 4 ++-- site/content/docs/5.2/components/modal.md | 2 +- site/content/docs/5.2/components/navs-tabs.md | 4 ++-- site/content/docs/5.2/components/offcanvas.md | 12 ++++++------ site/content/docs/5.2/components/popovers.md | 8 ++++---- site/content/docs/5.2/components/scrollspy.md | 2 +- site/content/docs/5.2/components/toasts.md | 10 +++++----- site/content/docs/5.2/components/tooltips.md | 8 ++++---- site/content/docs/5.2/getting-started/javascript.md | 4 ++-- site/content/docs/5.2/layout/breakpoints.md | 2 +- 14 files changed, 39 insertions(+), 39 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.2/components/buttons.md b/site/content/docs/5.2/components/buttons.md index 246641529..c2fdd75b1 100644 --- a/site/content/docs/5.2/components/buttons.md +++ b/site/content/docs/5.2/components/buttons.md @@ -187,8 +187,8 @@ const bsButton = new bootstrap.Button('#myButton') | Method | Description | | --- | --- | | `dispose` | Destroys an element's button. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the button instance associated to a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`| -| `getOrCreateInstance` | Static method which returns a button instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)` | +| `getInstance` | Static method which allows you to get the button instance associated to a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a button instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)`. | | `toggle` | Toggles push state. Gives the button the appearance that it has been activated. | {{< /bs-table >}} diff --git a/site/content/docs/5.2/components/carousel.md b/site/content/docs/5.2/components/carousel.md index 327916b2c..e32ce64eb 100644 --- a/site/content/docs/5.2/components/carousel.md +++ b/site/content/docs/5.2/components/carousel.md @@ -349,10 +349,10 @@ const carousel = new bootstrap.Carousel(myCarouselElement, { | --- | --- | | `cycle` | Cycles through the carousel items from left to right. | | `dispose` | Destroys an element's carousel. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the carousel instance associated to a DOM element, you can use it like this: `bootstrap.Carousel.getInstance(element)` | -| `getOrCreateInstance` | Static method which returns a carousel instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Carousel.getOrCreateInstance(element)` | +| `getInstance` | Static method which allows you to get the carousel instance associated to a DOM element, you can use it like this: `bootstrap.Carousel.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a carousel instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Carousel.getOrCreateInstance(element)`. | | `next` | Cycles to the next item. **Returns to the caller before the next item has been shown** (e.g., before the `slid.bs.carousel` event occurs). | -| `nextWhenVisible` | Don't cycle carousel to next when the page isn't visible or the carousel or its parent isn't visible. **Returns to the caller before the target item has been shown** | +| `nextWhenVisible` | Don't cycle carousel to next when the page isn't visible or the carousel or its parent isn't visible. **Returns to the caller before the target item has been shown**. | | `pause` | Stops the carousel from cycling through items. | | `prev` | Cycles to the previous item. **Returns to the caller before the previous item has been shown** (e.g., before the `slid.bs.carousel` event occurs). | | `to` | Cycles the carousel to a particular frame (0 based, similar to an array). **Returns to the caller before the target item has been shown** (e.g., before the `slid.bs.carousel` event occurs). | diff --git a/site/content/docs/5.2/components/collapse.md b/site/content/docs/5.2/components/collapse.md index 781998aaf..21be901c0 100644 --- a/site/content/docs/5.2/components/collapse.md +++ b/site/content/docs/5.2/components/collapse.md @@ -147,7 +147,7 @@ const collapseList = [...collapseElementList].map(collapseEl => new bootstrap.Co | Name | Type | Default | Description | | --- | --- | --- | --- | `parent` | selector, DOM element | `null` | If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the `card` class). The attribute has to be set on the target collapsible area. | -`toggle` | boolean | `true` | Toggles the collapsible element on invocation | +`toggle` | boolean | `true` | Toggles the collapsible element on invocation. | {{< /bs-table >}} ### Methods @@ -170,8 +170,8 @@ const bsCollapse = new bootstrap.Collapse('#myCollapse', { | Method | Description | | --- | --- | | `dispose` | Destroys an element's collapse. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the collapse instance associated to a DOM element, you can use it like this: `bootstrap.Collapse.getInstance(element)` | -| `getOrCreateInstance` | Static method which returns a collapse instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Collapse.getOrCreateInstance(element)` | +| `getInstance` | Static method which allows you to get the collapse instance associated to a DOM element, you can use it like this: `bootstrap.Collapse.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a collapse instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Collapse.getOrCreateInstance(element)`. | | `hide` | Hides a collapsible element. **Returns to the caller before the collapsible element has actually been hidden** (e.g., before the `hidden.bs.collapse` event occurs). | | `show` | Shows a collapsible element. **Returns to the caller before the collapsible element has actually been shown** (e.g., before the `shown.bs.collapse` event occurs). | | `toggle` | Toggles a collapsible element to shown or hidden. **Returns to the caller before the collapsible element has actually been shown or hidden** (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs). | diff --git a/site/content/docs/5.2/components/dropdowns.md b/site/content/docs/5.2/components/dropdowns.md index d654e1898..b58922775 100644 --- a/site/content/docs/5.2/components/dropdowns.md +++ b/site/content/docs/5.2/components/dropdowns.md @@ -1069,10 +1069,10 @@ Regardless of whether you call your dropdown via JavaScript or instead use the d {{< bs-table "table" >}} | Name | Type | Default | Description | | --- | --- | --- | --- | -| `autoClose` | boolean, string | `true` | Configure the auto close behavior of the dropdown:
  • `true` - the dropdown will be closed by clicking outside or inside the dropdown menu.
  • `false` - the dropdown will be closed by clicking the toggle button and manually calling `hide` or `toggle` method. (Also will not be closed by pressing esc key)
  • `'inside'` - the dropdown will be closed (only) by clicking inside the dropdown menu.
  • `'outside'` - the dropdown will be closed (only) by clicking outside the dropdown menu.
Note: the dropdown can always be closed with the ESC key | +| `autoClose` | boolean, string | `true` | Configure the auto close behavior of the dropdown:
  • `true` - the dropdown will be closed by clicking outside or inside the dropdown menu.
  • `false` - the dropdown will be closed by clicking the toggle button and manually calling `hide` or `toggle` method. (Also will not be closed by pressing esc key)
  • `'inside'` - the dropdown will be closed (only) by clicking inside the dropdown menu.
  • `'outside'` - the dropdown will be closed (only) by clicking outside the dropdown menu.
Note: the dropdown can always be closed with the ESC key. | | `boundary` | string, element | `'clippingParents'` | Overflow constraint boundary of the dropdown menu (applies only to Popper's preventOverflow modifier). By default it's `clippingParents` and can accept an HTMLElement reference (via JavaScript only). For more information refer to Popper's [detectOverflow docs](https://popper.js.org/docs/v2/utils/detect-overflow/#boundary). | | `display` | string | `'dynamic'` | By default, we use Popper for dynamic positioning. Disable this with `static`. | -| `offset` | array, string, function | `[0, 2]` | Offset of the dropdown relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | +| `offset` | array, string, function | `[0, 2]` | Offset of the dropdown relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | | `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper. | | `reference` | string, element, object | `'toggle'` | Reference element of the dropdown menu. Accepts the values of `'toggle'`, `'parent'`, an HTMLElement reference or an object providing `getBoundingClientRect`. For more information refer to Popper's [constructor docs](https://popper.js.org/docs/v2/constructors/#createpopper) and [virtual element docs](https://popper.js.org/docs/v2/virtual-elements/). | {{< /bs-table >}} @@ -1095,7 +1095,7 @@ const dropdown = new bootstrap.Dropdown(element, { | Method | Description | | --- | --- | | `dispose` | Destroys an element's dropdown. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the dropdown instance associated to a DOM element, you can use it like this: `bootstrap.Dropdown.getInstance(element)` | +| `getInstance` | Static method which allows you to get the dropdown instance associated to a DOM element, you can use it like this: `bootstrap.Dropdown.getInstance(element)`. | | `getOrCreateInstance` | Static method which returns a dropdown instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Dropdown.getOrCreateInstance(element)`. | | `hide` | Hides the dropdown menu of a given navbar or tabbed navigation. | | `show` | Shows the dropdown menu of a given navbar or tabbed navigation. | diff --git a/site/content/docs/5.2/components/list-group.md b/site/content/docs/5.2/components/list-group.md index 563d5b527..1fe7d4bc5 100644 --- a/site/content/docs/5.2/components/list-group.md +++ b/site/content/docs/5.2/components/list-group.md @@ -485,7 +485,7 @@ Destroys an element's tab. #### getInstance -*Static* method which allows you to get the tab instance associated with a DOM element +*Static* method which allows you to get the tab instance associated with a DOM element. ```js const tab = bootstrap.Tab.getInstance('#trigger') // Returns a Bootstrap tab instance @@ -493,7 +493,7 @@ const tab = bootstrap.Tab.getInstance('#trigger') // Returns a Bootstrap tab ins #### getOrCreateInstance -*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialized +*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialized. ```js const tab = bootstrap.Tab.getOrCreateInstance('#trigger') // Returns a Bootstrap tab instance diff --git a/site/content/docs/5.2/components/modal.md b/site/content/docs/5.2/components/modal.md index aa6012cb0..e1e615ea6 100644 --- a/site/content/docs/5.2/components/modal.md +++ b/site/content/docs/5.2/components/modal.md @@ -858,7 +858,7 @@ const myModal = new bootstrap.Modal('#myModal', { | `getOrCreateInstance` | *Static* method which allows you to get the modal instance associated with a DOM element, or create a new one in case it wasn't initialized. | | `handleUpdate` | Manually readjust the modal's position if the height of a modal changes while it is open (i.e. in case a scrollbar appears). | | `hide` | Manually hides a modal. **Returns to the caller before the modal has actually been hidden** (i.e. before the `hidden.bs.modal` event occurs). | -| `show` | Manually opens a modal. **Returns to the caller before the modal has actually been shown** (i.e. before the `shown.bs.modal` event occurs). Also, you can pass a DOM element as an argument that can be received in the modal events (as the `relatedTarget` property). (i.e. `const modalToggle = document.getElementById('toggleMyModal'); myModal.show(modalToggle)` | +| `show` | Manually opens a modal. **Returns to the caller before the modal has actually been shown** (i.e. before the `shown.bs.modal` event occurs). Also, you can pass a DOM element as an argument that can be received in the modal events (as the `relatedTarget` property). (i.e. `const modalToggle = document.getElementById('toggleMyModal'); myModal.show(modalToggle)`. | | `toggle` | Manually toggles a modal. **Returns to the caller before the modal has actually been shown or hidden** (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs). | {{< /bs-table >}} diff --git a/site/content/docs/5.2/components/navs-tabs.md b/site/content/docs/5.2/components/navs-tabs.md index 2b58bdd72..69ab7e5f3 100644 --- a/site/content/docs/5.2/components/navs-tabs.md +++ b/site/content/docs/5.2/components/navs-tabs.md @@ -677,7 +677,7 @@ Destroys an element's tab. #### getInstance -*Static* method which allows you to get the tab instance associated with a DOM element +*Static* method which allows you to get the tab instance associated with a DOM element. ```js const tab = bootstrap.Tab.getInstance('#trigger') // Returns a Bootstrap tab instance @@ -685,7 +685,7 @@ const tab = bootstrap.Tab.getInstance('#trigger') // Returns a Bootstrap tab ins #### getOrCreateInstance -*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialized +*Static* method which allows you to get the tab instance associated with a DOM element, or create a new one in case it wasn't initialized. ```js const tab = bootstrap.Tab.getOrCreateInstance('#trigger') // Returns a Bootstrap tab instance diff --git a/site/content/docs/5.2/components/offcanvas.md b/site/content/docs/5.2/components/offcanvas.md index c83e88716..c4290adf2 100644 --- a/site/content/docs/5.2/components/offcanvas.md +++ b/site/content/docs/5.2/components/offcanvas.md @@ -303,8 +303,8 @@ const offcanvasList = [...offcanvasElementList].map(offcanvasEl => new bootstrap | Name | Type | Default | Description | | --- | --- | --- | --- | | `backdrop` | boolean or the string `static` | `true` | Apply a backdrop on body while offcanvas is open. Alternatively, specify `static` for a backdrop which doesn't close the offcanvas when clicked. | -| `keyboard` | boolean | `true` | Closes the offcanvas when escape key is pressed | -| `scroll` | boolean | `false` | Allow body scrolling while offcanvas is open | +| `keyboard` | boolean | `true` | Closes the offcanvas when escape key is pressed. | +| `scroll` | boolean | `false` | Allow body scrolling while offcanvas is open. | {{< /bs-table >}} ### Methods @@ -324,10 +324,10 @@ const bsOffcanvas = new bootstrap.Offcanvas('#myOffcanvas') {{< bs-table "table" >}} | Method | Description | | --- | --- | -| `getInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element | -| `getOrCreateInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element, or create a new one in case it wasn't initialized | -| `hide` | Hides an offcanvas element. **Returns to the caller before the offcanvas element has actually been hidden** (i.e. before the `hidden.bs.offcanvas` event occurs).| -| `show` | Shows an offcanvas element. **Returns to the caller before the offcanvas element has actually been shown** (i.e. before the `shown.bs.offcanvas` event occurs).| +| `getInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element. | +| `getOrCreateInstance` | *Static* method which allows you to get the offcanvas instance associated with a DOM element, or create a new one in case it wasn't initialized. | +| `hide` | Hides an offcanvas element. **Returns to the caller before the offcanvas element has actually been hidden** (i.e. before the `hidden.bs.offcanvas` event occurs). | +| `show` | Shows an offcanvas element. **Returns to the caller before the offcanvas element has actually been shown** (i.e. before the `shown.bs.offcanvas` event occurs). | | `toggle` | Toggles an offcanvas element to shown or hidden. **Returns to the caller before the offcanvas element has actually been shown or hidden** (i.e. before the `shown.bs.offcanvas` or `hidden.bs.offcanvas` event occurs). | {{< /bs-table >}} diff --git a/site/content/docs/5.2/components/popovers.md b/site/content/docs/5.2/components/popovers.md index 87e756434..e8e693f5d 100644 --- a/site/content/docs/5.2/components/popovers.md +++ b/site/content/docs/5.2/components/popovers.md @@ -188,17 +188,17 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt | Name | Type | Default | Description | | --- | --- | --- | --- | | `allowList` | object | [Default value]({{< docsref "/getting-started/javascript#sanitizer" >}}) | Object which contains allowed attributes and tags. | -| `animation` | boolean | `true` | Apply a CSS fade transition to the popover | +| `animation` | boolean | `true` | Apply a CSS fade transition to the popover. | | `boundary` | string, element | `'clippingParents'` | Overflow constraint boundary of the popover (applies only to Popper's preventOverflow modifier). By default, it's `'clippingParents'` and can accept an HTMLElement reference (via JavaScript only). For more information refer to Popper's [detectOverflow docs](https://popper.js.org/docs/v2/utils/detect-overflow/#boundary). | | `container` | string, element, false | `false` | Appends the popover to a specific element. Example: `container: 'body'`. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize. | -| `content` | string, element, function | `''` | Default content value if `data-bs-content` attribute isn't present. If a function is given, it will be called with its `this` reference set to the element that the popover is attached to. +| `content` | string, element, function | `''` | Default content value if `data-bs-content` attribute isn't present. If a function is given, it will be called with its `this` reference set to the element that the popover is attached to. | | `customClass` | string, function | `''` | Add classes to the popover when it is shown. Note that these classes will be added in addition to any classes specified in the template. To add multiple classes, separate them with spaces: `'class-1 class-2'`. You can also pass a function that should return a single string containing additional class names. | | `delay` | number, object | `0` | Delay showing and hiding the popover (ms)—doesn't apply to manual trigger type. If a number is supplied, delay is applied to both hide/show. Object structure is: `delay: { "show": 500, "hide": 100 }`. | | `fallbackPlacements` | string, array | `['top', 'right', 'bottom', 'left']` | Define fallback placements by providing a list of placements in array (in order of preference). For more information refer to Popper's [behavior docs](https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements). | | `html` | boolean | `false` | Allow HTML in the popover. If true, HTML tags in the popover's `title` will be rendered in the popover. If false, `innerText` property will be used to insert content into the DOM. Use text if you're worried about XSS attacks. | | `offset` | number, string, function | `[0, 0]` | Offset of the popover relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | | `placement` | string, function | `'top'` | How to position the popover: auto, top, bottom, left, right. When `auto` is specified, it will dynamically reorient the popover. When a function is used to determine the placement, it is called with the popover DOM node as its first argument and the triggering element DOM node as its second. The `this` context is set to the popover instance. | -| `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper.| +| `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper. | | `sanitize` | boolean | `true` | Enable or disable the sanitization. If activated `'template'`, `'content'` and `'title'` options will be sanitized. | | `sanitizeFn` | null, function | `null` | Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization. | | `selector` | string, false | `false` | If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to also apply popovers to dynamically added DOM elements (`jQuery.on` support). See [this issue]({{< param repo >}}/issues/4215) and [an informative example](https://codepen.io/Johann-S/pen/djJYPb). | @@ -238,7 +238,7 @@ const popover = new bootstrap.Popover(element, { | `dispose` | Hides and destroys an element's popover (Removes stored data on the DOM element). Popovers that use delegation (which are created using [the `selector` option](#options)) cannot be individually destroyed on descendant trigger elements. | | `enable` | Gives an element's popover the ability to be shown. **Popovers are enabled by default.** | | `getInstance` | _Static_ method which allows you to get the popover instance associated with a DOM element. | -| `getOrCreateInstance` | *Static* method which allows you to get the popover instance associated with a DOM element, or create a new one in case it wasn't initialized | +| `getOrCreateInstance` | *Static* method which allows you to get the popover instance associated with a DOM element, or create a new one in case it wasn't initialized. | | `hide` | Hides an element's popover. **Returns to the caller before the popover has actually been hidden** (i.e. before the `hidden.bs.popover` event occurs). This is considered a "manual" triggering of the popover. | | `setContent` | Gives a way to change the popover's content after its initialization. | | `show` | Reveals an element's popover. **Returns to the caller before the popover has actually been shown** (i.e. before the `shown.bs.popover` event occurs). This is considered a "manual" triggering of the popover. Popovers whose title and content are both zero-length are never displayed. | diff --git a/site/content/docs/5.2/components/scrollspy.md b/site/content/docs/5.2/components/scrollspy.md index 7c5985eee..9f1aaadf5 100644 --- a/site/content/docs/5.2/components/scrollspy.md +++ b/site/content/docs/5.2/components/scrollspy.md @@ -397,7 +397,7 @@ To keep backwards compatibility, we will continue to parse a given `offset` to ` | Method | Description | | --- | --- | | `dispose` | Destroys an element's scrollspy. (Removes stored data on the DOM element) | -| `getInstance` | *Static* method to get the scrollspy instance associated with a DOM element | +| `getInstance` | *Static* method to get the scrollspy instance associated with a DOM element. | | `getOrCreateInstance` | *Static* method to get the scrollspy instance associated with a DOM element, or to create a new one in case it wasn't initialized. | | `refresh` | When adding or removing elements in the DOM, you'll need to call the refresh method. | {{< /bs-table >}} diff --git a/site/content/docs/5.2/components/toasts.md b/site/content/docs/5.2/components/toasts.md index a9c46bb08..abcb3928a 100644 --- a/site/content/docs/5.2/components/toasts.md +++ b/site/content/docs/5.2/components/toasts.md @@ -360,9 +360,9 @@ const toastList = [...toastElList].map(toastEl => new bootstrap.Toast(toastEl, o {{< bs-table "table" >}} | Name | Type | Default | Description | | --- | --- | --- | --- | -| `animation` | boolean | `true` | Apply a CSS fade transition to the toast | -| `autohide` | boolean | `true` | Automatically hide the toast after the delay | -| `delay` | number | `5000` | Delay in milliseconds before hiding the toast | +| `animation` | boolean | `true` | Apply a CSS fade transition to the toast. | +| `autohide` | boolean | `true` | Automatically hide the toast after the delay. | +| `delay` | number | `5000` | Delay in milliseconds before hiding the toast. | {{< /bs-table >}} ### Methods @@ -375,8 +375,8 @@ const toastList = [...toastElList].map(toastEl => new bootstrap.Toast(toastEl, o | Method | Description | | --- | --- | | `dispose` | Hides an element's toast. Your toast will remain on the DOM but won't show anymore. | -| `getInstance` | *Static* method which allows you to get the toast instance associated with a DOM element.
For example: `const myToastEl = document.getElementById('myToastEl')` `const myToast = bootstrap.Toast.getInstance(myToastEl)` Returns a Bootstrap toast instance| -| `getOrCreateInstance` | *Static* method which allows you to get the toast instance associated with a DOM element, or create a new one, in case it wasn't initialized.
`const myToastEl = document.getElementById('myToastEl')` `const myToast = bootstrap.Toast.getOrCreateInstance(myToastEl)` Returns a Bootstrap toast instance | +| `getInstance` | *Static* method which allows you to get the toast instance associated with a DOM element.
For example: `const myToastEl = document.getElementById('myToastEl')` `const myToast = bootstrap.Toast.getInstance(myToastEl)` Returns a Bootstrap toast instance. | +| `getOrCreateInstance` | *Static* method which allows you to get the toast instance associated with a DOM element, or create a new one, in case it wasn't initialized.
`const myToastEl = document.getElementById('myToastEl')` `const myToast = bootstrap.Toast.getOrCreateInstance(myToastEl)` Returns a Bootstrap toast instance. | | `hide` | Hides an element's toast. **Returns to the caller before the toast has actually been hidden** (i.e. before the `hidden.bs.toast` event occurs). You have to manually call this method if you made `autohide` to `false`. | | `isShown` | Returns a boolean according to toast's visibility state. | | `show` | Reveals an element's toast. **Returns to the caller before the toast has actually been shown** (i.e. before the `shown.bs.toast` event occurs). You have to manually call this method, instead your toast won't show. | diff --git a/site/content/docs/5.2/components/tooltips.md b/site/content/docs/5.2/components/tooltips.md index dcea9601f..834b4ea15 100644 --- a/site/content/docs/5.2/components/tooltips.md +++ b/site/content/docs/5.2/components/tooltips.md @@ -207,7 +207,7 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt | Name | Type | Default | Description | | --- | --- | --- | --- | | `allowList` | object | [Default value]({{< docsref "/getting-started/javascript#sanitizer" >}}) | Object which contains allowed attributes and tags. | -| `animation` | boolean | `true` | Apply a CSS fade transition to the tooltip | +| `animation` | boolean | `true` | Apply a CSS fade transition to the tooltip. | | `boundary` | string, element | `'clippingParents'` | Overflow constraint boundary of the tooltip (applies only to Popper's preventOverflow modifier). By default, it's `'clippingParents'` and can accept an HTMLElement reference (via JavaScript only). For more information refer to Popper's [detectOverflow docs](https://popper.js.org/docs/v2/utils/detect-overflow/#boundary). | | `container` | string, element, false | `false` | Appends the tooltip to a specific element. Example: `container: 'body'`. This option is particularly useful in that it allows you to position the tooltip in the flow of the document near the triggering element - which will prevent the tooltip from floating away from the triggering element during a window resize. | | `customClass` | string, function | `''` | Add classes to the tooltip when it is shown. Note that these classes will be added in addition to any classes specified in the template. To add multiple classes, separate them with spaces: `'class-1 class-2'`. You can also pass a function that should return a single string containing additional class names. | @@ -216,7 +216,7 @@ Note that for security reasons the `sanitize`, `sanitizeFn`, and `allowList` opt | `html` | boolean | `false` | Allow HTML in the tooltip. If true, HTML tags in the tooltip's `title` will be rendered in the tooltip. If false, `innerText` property will be used to insert content into the DOM. Use text if you're worried about XSS attacks. | | `offset` | array, string, function | `[0, 0]` | Offset of the tooltip relative to its target. You can pass a string in data attributes with comma separated values like: `data-bs-offset="10,20"`. When a function is used to determine the offset, it is called with an object containing the popper placement, the reference, and popper rects as its first argument. The triggering element DOM node is passed as the second argument. The function must return an array with two numbers: [skidding](https://popper.js.org/docs/v2/modifiers/offset/#skidding-1), [distance](https://popper.js.org/docs/v2/modifiers/offset/#distance-1). For more information refer to Popper's [offset docs](https://popper.js.org/docs/v2/modifiers/offset/#options). | | `placement` | string, function | `'top'` | How to position the tooltip: auto, top, bottom, left, right. When `auto` is specified, it will dynamically reorient the tooltip. When a function is used to determine the placement, it is called with the tooltip DOM node as its first argument and the triggering element DOM node as its second. The `this` context is set to the tooltip instance. | -| `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper.| +| `popperConfig` | null, object, function | `null` | To change Bootstrap's default Popper config, see [Popper's configuration](https://popper.js.org/docs/v2/constructors/#options). When a function is used to create the Popper configuration, it's called with an object that contains the Bootstrap's default Popper configuration. It helps you use and merge the default with your own configuration. The function must return a configuration object for Popper. | | `sanitize` | boolean | `true` | Enable or disable the sanitization. If activated `'template'`, `'content'` and `'title'` options will be sanitized. | | `sanitizeFn` | null, function | `null` | Here you can supply your own sanitize function. This can be useful if you prefer to use a dedicated library to perform sanitization. | | `selector` | string, false | `false` | If a selector is provided, tooltip objects will be delegated to the specified targets. In practice, this is used to also apply tooltips to dynamically added DOM elements (`jQuery.on` support). See [this issue]({{< param repo >}}/issues/4215) and [an informative example](https://codepen.io/Johann-S/pen/djJYPb). | @@ -255,8 +255,8 @@ const tooltip = new bootstrap.Tooltip(element, { | `disable` | Removes the ability for an element's tooltip to be shown. The tooltip will only be able to be shown if it is re-enabled. | | `dispose` | Hides and destroys an element's tooltip (Removes stored data on the DOM element). Tooltips that use delegation (which are created using [the `selector` option](#options)) cannot be individually destroyed on descendant trigger elements. | | `enable` | Gives an element's tooltip the ability to be shown. **Tooltips are enabled by default.** | -| `getInstance` | *Static* method which allows you to get the tooltip instance associated with a DOM element, or create a new one in case it wasn't initialized | -| `getOrCreateInstance` | *Static* method which allows you to get the tooltip instance associated with a DOM element, or create a new one in case it wasn't initialized | +| `getInstance` | *Static* method which allows you to get the tooltip instance associated with a DOM element, or create a new one in case it wasn't initialized. | +| `getOrCreateInstance` | *Static* method which allows you to get the tooltip instance associated with a DOM element, or create a new one in case it wasn't initialized. | | `hide` | Hides an element's tooltip. **Returns to the caller before the tooltip has actually been hidden** (i.e. before the `hidden.bs.tooltip` event occurs). This is considered a "manual" triggering of the tooltip. | | `setContent` | Gives a way to change the tooltip's content after its initialization. | | `show` | Reveals an element's tooltip. **Returns to the caller before the tooltip has actually been shown** (i.e. before the `shown.bs.tooltip` event occurs). This is considered a "manual" triggering of the tooltip. Tooltips with zero-length titles are never displayed. | diff --git a/site/content/docs/5.2/getting-started/javascript.md b/site/content/docs/5.2/getting-started/javascript.md index fa157e006..c4ba6b0f7 100644 --- a/site/content/docs/5.2/getting-started/javascript.md +++ b/site/content/docs/5.2/getting-started/javascript.md @@ -222,8 +222,8 @@ Every Bootstrap plugin exposes the following methods and static properties. {{< bs-table "table" >}} | Static property | Description | | --- | --- | -| `NAME` | Returns the plugin name. (Example: `bootstrap.Tooltip.NAME`) | -| `VERSION` | The version of each of Bootstrap's plugins can be accessed via the `VERSION` property of the plugin's constructor (Example: `bootstrap.Tooltip.VERSION`) | +| `NAME` | Returns the plugin name. (Example: `bootstrap.Tooltip.NAME`) | +| `VERSION` | The version of each of Bootstrap's plugins can be accessed via the `VERSION` property of the plugin's constructor (Example: `bootstrap.Tooltip.VERSION`) | {{< /bs-table >}} ## Sanitizer diff --git a/site/content/docs/5.2/layout/breakpoints.md b/site/content/docs/5.2/layout/breakpoints.md index df56924b3..e773b8f9a 100644 --- a/site/content/docs/5.2/layout/breakpoints.md +++ b/site/content/docs/5.2/layout/breakpoints.md @@ -22,7 +22,7 @@ Bootstrap includes six default breakpoints, sometimes referred to as _grid tiers {{< bs-table "table" >}} | Breakpoint | Class infix | Dimensions | | --- | --- | --- | -| Extra small | None |<576px | +| Extra small | None |<576px | | Small | `sm` | ≥576px | | Medium | `md` | ≥768px | | Large | `lg` | ≥992px | -- cgit v1.2.3 From b5f2d5a31e24455447939c3a7487a4fe89a66ba6 Mon Sep 17 00:00:00 2001 From: Philip Wedemann <22521688+hfhbd@users.noreply.github.com> Date: Fri, 3 Jun 2022 16:28:33 +0200 Subject: Replace wrong mobile OS Windows with iOS --- site/content/docs/5.2/getting-started/browsers-devices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.2/getting-started/browsers-devices.md b/site/content/docs/5.2/getting-started/browsers-devices.md index 41885feaa..dc550ecb9 100644 --- a/site/content/docs/5.2/getting-started/browsers-devices.md +++ b/site/content/docs/5.2/getting-started/browsers-devices.md @@ -30,7 +30,7 @@ Generally speaking, Bootstrap supports the latest versions of each major platfor | | Chrome | Firefox | Safari | Android Browser & WebView | | --- | --- | --- | --- | --- | | **Android** | Supported | Supported | | v6.0+ | -| **Windows** | Supported | Supported | Supported | | +| **iOS** | Supported | Supported | Supported | | {{< /bs-table >}} ### Desktop browsers -- cgit v1.2.3 From 4f97d8fabda142685e36391da2c37c7e09955ac6 Mon Sep 17 00:00:00 2001 From: charlesroelli <3193168+charlesroelli@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:14:07 +0200 Subject: Document how to extract CSS, SVG for strict CSP (#36587) * Webpack: explain how to extract CSS from bundle * Webpack: explain how to extract SVG from bundle * Update webpack.md Co-authored-by: Mark Otto --- site/content/docs/5.2/customize/overview.md | 2 +- site/content/docs/5.2/getting-started/webpack.md | 87 ++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.2/customize/overview.md b/site/content/docs/5.2/customize/overview.md index 1b332bfe4..d0a853cd6 100644 --- a/site/content/docs/5.2/customize/overview.md +++ b/site/content/docs/5.2/customize/overview.md @@ -48,4 +48,4 @@ Several Bootstrap components include embedded SVGs in our CSS to style component - [Navbar toggle buttons]({{< docsref "/components/navbar#responsive-behaviors" >}}) - [Select menus]({{< docsref "/forms/select" >}}) -Based on [community conversation](https://github.com/twbs/bootstrap/issues/25394), some options for addressing this in your own codebase include replacing the URLs with locally hosted assets, removing the images and using inline images (not possible in all components), and modifying your CSP. Our recommendation is to carefully review your own security policies and decide on the best path forward, if necessary. +Based on [community conversation](https://github.com/twbs/bootstrap/issues/25394), some options for addressing this in your own codebase include [replacing the URLs with locally hosted assets]({{< docsref "/getting-started/webpack#extracting-svg-files" >}}), removing the images and using inline images (not possible in all components), and modifying your CSP. Our recommendation is to carefully review your own security policies and decide on the best path forward, if necessary. diff --git a/site/content/docs/5.2/getting-started/webpack.md b/site/content/docs/5.2/getting-started/webpack.md index ca104f98c..86bab39eb 100644 --- a/site/content/docs/5.2/getting-started/webpack.md +++ b/site/content/docs/5.2/getting-started/webpack.md @@ -230,6 +230,93 @@ Importing Bootstrap into Webpack requires the loaders we installed in the first Now you can start adding any Bootstrap components you want to use. Be sure to [check out the complete Webpack example project](https://github.com/twbs/examples/tree/main/webpack) for how to include additional custom Sass and optimize your build by importing only the parts of Bootstrap's CSS and JS that you need. +## Production optimizations + +Depending on your setup, you may want to implement some additional security and speed optimizations useful for running the project in production. Note that these optimizations are not applied on [the Webpack example project](https://github.com/twbs/examples/tree/main/webpack) and are up to you to implement. + +### Extracting CSS + +The `style-loader` we configured above conveniently emits CSS into the bundle so that manually loading a CSS file in `dist/index.html` isn't necessary. This approach may not work with a strict Content Security Policy, however, and it may become a bottleneck in your application due to the large bundle size. + +To separate the CSS so that we can load it directly from `dist/index.html`, use the `mini-css-extract-loader` Webpack plugin. + +First, install the plugin: + +```sh +npm install --save-dev mini-css-extract-plugin +``` + +Then instantiate and use the plugin in the Webpack configuration: + +```diff +--- a/webpack/webpack.config.js ++++ b/webpack/webpack.config.js +@@ -1,8 +1,10 @@ ++const miniCssExtractPlugin = require('mini-css-extract-plugin') + const path = require('path') + + module.exports = { + mode: 'development', + entry: './src/js/main.js', ++ plugins: [new miniCssExtractPlugin()], + output: { + filename: "main.js", + path: path.resolve(__dirname, "dist"), +@@ -18,8 +20,8 @@ module.exports = { + test: /\.(scss)$/, + use: [ + { +- // Adds CSS to the DOM by injecting a ` {{ range .Page.Params.extra_css }} @@ -80,6 +100,57 @@ {{- end }} + + + + + + + + + + + + + + + + + + {{ .Content }} {{ if ne .Page.Params.include_js false -}} -- cgit v1.2.3 From ea19c3da8ac33c7676debfc2ac91c196e861f358 Mon Sep 17 00:00:00 2001 From: Andrew Dawes Date: Fri, 3 Mar 2023 07:59:45 +0100 Subject: Fixed some grammar issues --- site/content/docs/5.3/extend/approach.md | 2 +- site/content/docs/5.3/forms/validation.md | 2 +- site/content/docs/5.3/migration.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/extend/approach.md b/site/content/docs/5.3/extend/approach.md index e19891e94..392aef4d3 100644 --- a/site/content/docs/5.3/extend/approach.md +++ b/site/content/docs/5.3/extend/approach.md @@ -18,7 +18,7 @@ We'll dive into each of these more throughout, but at a high level, here's what - Components should be responsive and mobile-first - Components should be built with a base class and extended via modifier classes - Component states should obey a common z-index scale -- Whenever possible, prefer a HTML and CSS implementation over JavaScript +- Whenever possible, prefer an HTML and CSS implementation over JavaScript - Whenever possible, use utilities over custom styles - Whenever possible, avoid enforcing strict HTML requirements (children selectors) diff --git a/site/content/docs/5.3/forms/validation.md b/site/content/docs/5.3/forms/validation.md index 0371d229d..5eb18f025 100644 --- a/site/content/docs/5.3/forms/validation.md +++ b/site/content/docs/5.3/forms/validation.md @@ -371,7 +371,7 @@ These variables are also color mode adaptive, meaning they change color while in ### Sass mixins -Two mixins are combined together, through our [loop](#loop), to generate our form validation feedback styles. +Two mixins are combined, through our [loop](#loop), to generate our form validation feedback styles. {{< scss-docs name="form-validation-mixins" file="scss/mixins/_forms.scss" >}} diff --git a/site/content/docs/5.3/migration.md b/site/content/docs/5.3/migration.md index 3cf60aaf2..0321e9661 100644 --- a/site/content/docs/5.3/migration.md +++ b/site/content/docs/5.3/migration.md @@ -214,9 +214,9 @@ We've also introduced a new `.progress-stacked` class to more logically wrap [mu ### Utilities -- Deprecated `.text-muted` will be be replaced by `.text-body-secondary` in v6. +- Deprecated `.text-muted` will be replaced by `.text-body-secondary` in v6. - With the addition of the expanded theme colors and variables, the `.text-muted` variables and utility have been deprecated with v5.3.0. Its default value has also has been reassigned to the new `--bs-secondary-color` CSS variable to better support color modes. It will be removed in v6.0.0. + With the addition of the expanded theme colors and variables, the `.text-muted` variables and utility have been deprecated with v5.3.0. Its default value has also been reassigned to the new `--bs-secondary-color` CSS variable to better support color modes. It will be removed in v6.0.0. - Adds new `.overflow-x`, `.overflow-y`, and several `.object-fit-*` utilities. _The object-fit property is used to specify how an `` or `
{{ end }} {{ if $entry.external }}
- +

-- cgit v1.2.3 From 423f112b2332e04d900a2668d6c0ac6c0c2e42ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Tue, 7 Mar 2023 06:49:38 +0100 Subject: Docs: minor modifications in our migration guide for the v5.3.0-alpha2 (#38177) --- site/content/docs/5.3/migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/migration.md b/site/content/docs/5.3/migration.md index 0321e9661..afca35155 100644 --- a/site/content/docs/5.3/migration.md +++ b/site/content/docs/5.3/migration.md @@ -69,7 +69,7 @@ If you're migrating from our previous alpha release of v5.3.0, please reviewing ### Docs -- Examples are now displayed with the appropriate light or dark color mode as dictated by the setting in our docs. However, they lack an individual color mode picker for the time being. +- Examples are now displayed with the appropriate light or dark color mode as dictated by the setting in our docs. Each example has an individual color mode picker. - Improved included JavaScript for live Toast demo. @@ -150,7 +150,7 @@ Learn more by reading the new [color modes documentation]({{< docsref "/customiz #### Dropdowns -- Deprecated The `.dropdown-menu-dark` class has been deprecated and replaced with `data-bs-theme="dark"` on the close button or any parent element. [See the docs for an example.]({{< docsref "/components/dropdowns#dark-dropdowns" >}}) +- Deprecated The `.dropdown-menu-dark` class has been deprecated and replaced with `data-bs-theme="dark"` on the dropdown or any parent element. [See the docs for an example.]({{< docsref "/components/dropdowns#dark-dropdowns" >}}) #### Close button -- cgit v1.2.3 From 3cec38c368346594aefad5d6185c599c670b1c02 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 7 Mar 2023 21:46:50 -0800 Subject: Fixes click area for header example snippet --- site/content/docs/5.3/examples/headers/index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/examples/headers/index.html b/site/content/docs/5.3/examples/headers/index.html index 6262025e8..a0c87f67e 100644 --- a/site/content/docs/5.3/examples/headers/index.html +++ b/site/content/docs/5.3/examples/headers/index.html @@ -68,9 +68,11 @@ body_class: ""
- - - +
+ + + +
@@ -332,7 +332,7 @@ Add some navigation to a card's header (or block) with Bootstrap's [nav componen Link

diff --git a/site/content/docs/5.3/components/dropdowns.md b/site/content/docs/5.3/components/dropdowns.md index 098882064..6e3811f1f 100644 --- a/site/content/docs/5.3/components/dropdowns.md +++ b/site/content/docs/5.3/components/dropdowns.md @@ -661,7 +661,7 @@ Add `.disabled` to items in the dropdown to **style them as disabled**. {{< example >}} {{< /example >}} diff --git a/site/content/docs/5.3/components/list-group.md b/site/content/docs/5.3/components/list-group.md index 6c22809f9..598bb38d6 100644 --- a/site/content/docs/5.3/components/list-group.md +++ b/site/content/docs/5.3/components/list-group.md @@ -62,7 +62,7 @@ Be sure to **not use the standard `.btn` classes here**. A second link item A third link item A fourth link item - A disabled link item + A disabled link item
{{< /example >}} diff --git a/site/content/docs/5.3/components/navbar.md b/site/content/docs/5.3/components/navbar.md index 83aaaa403..ab6c2305c 100644 --- a/site/content/docs/5.3/components/navbar.md +++ b/site/content/docs/5.3/components/navbar.md @@ -63,7 +63,7 @@ Here's an example of all the sub-components included in a responsive light-theme @@ -157,7 +157,7 @@ Please note that you should also add the `aria-current` attribute on the active Pricing
@@ -179,7 +179,7 @@ And because we use classes for our navs, you can avoid the list-based approach e Home Features Pricing - Disabled + Disabled
@@ -538,7 +538,7 @@ Here's an example navbar using `.navbar-nav-scroll` with `style="--bs-scroll-hei @@ -578,7 +578,7 @@ With no `.navbar-brand` shown at the smallest breakpoint: Link @@ -608,7 +608,7 @@ With a brand name shown on the left and toggler on the right: Link @@ -638,7 +638,7 @@ With a toggler on the left and brand name on the right: Link diff --git a/site/content/docs/5.3/components/navs-tabs.md b/site/content/docs/5.3/components/navs-tabs.md index 49d77e9f3..0a99e34f8 100644 --- a/site/content/docs/5.3/components/navs-tabs.md +++ b/site/content/docs/5.3/components/navs-tabs.md @@ -31,7 +31,7 @@ To convey the active state to assistive technologies, use the `aria-current` att Link {{< /example >}} @@ -43,7 +43,7 @@ Classes are used throughout, so your markup can be super flexible. Use ` {{< /example >}} @@ -88,7 +88,7 @@ Right-aligned with `.justify-content-end`: Link {{< /example >}} @@ -109,7 +109,7 @@ Stack your navigation by changing the flex item direction with the `.flex-column Link {{< /example >}} @@ -121,7 +121,7 @@ As always, vertical navigation is possible without ` {{< /example >}} @@ -162,7 +162,7 @@ Take that same HTML, but use `.nav-pills` instead: Link {{< /example >}} @@ -183,7 +183,7 @@ Take that same HTML, but use `.nav-underline` instead: Link {{< /example >}} @@ -204,7 +204,7 @@ Force your `.nav`'s contents to extend the full available width with one of two Link {{< /example >}} @@ -216,7 +216,7 @@ When using a ` {{< /example >}} @@ -234,7 +234,7 @@ For equal-width elements, use `.nav-justified`. All horizontal space will be occ Link {{< /example >}} @@ -246,7 +246,7 @@ Similar to the `.nav-fill` example using a ` {{< /example >}} @@ -259,7 +259,7 @@ If you need responsive nav variations, consider using a series of [flexbox utili Active Longer nav link Link - Disabled + Disabled {{< /example >}} @@ -294,7 +294,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin Link {{< /example >}} @@ -320,7 +320,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin Link {{< /example >}} diff --git a/site/content/docs/5.3/components/placeholders.md b/site/content/docs/5.3/components/placeholders.md index 3dca3476b..8317b1184 100644 --- a/site/content/docs/5.3/components/placeholders.md +++ b/site/content/docs/5.3/components/placeholders.md @@ -38,7 +38,7 @@ In the example below, we take a typical card component and recreate it with plac

- +
@@ -67,7 +67,7 @@ In the example below, we take a typical card component and recreate it with plac

- +
``` @@ -83,7 +83,7 @@ We apply additional styling to `.btn`s via `::before` to ensure the `height` is

- + {{< /example >}} {{< callout info >}} diff --git a/site/content/docs/5.3/examples/blog-rtl/index.html b/site/content/docs/5.3/examples/blog-rtl/index.html index 83d7cfdaf..97d991302 100644 --- a/site/content/docs/5.3/examples/blog-rtl/index.html +++ b/site/content/docs/5.3/examples/blog-rtl/index.html @@ -172,7 +172,7 @@ extra_css: diff --git a/site/content/docs/5.3/examples/blog/index.html b/site/content/docs/5.3/examples/blog/index.html index 904d360d8..993c84e03 100644 --- a/site/content/docs/5.3/examples/blog/index.html +++ b/site/content/docs/5.3/examples/blog/index.html @@ -224,7 +224,7 @@ extra_css: diff --git a/site/content/docs/5.3/examples/carousel-rtl/index.html b/site/content/docs/5.3/examples/carousel-rtl/index.html index db184d71b..fbbe7dca9 100644 --- a/site/content/docs/5.3/examples/carousel-rtl/index.html +++ b/site/content/docs/5.3/examples/carousel-rtl/index.html @@ -22,7 +22,7 @@ extra_css: حلقة الوصل diff --git a/site/content/docs/5.3/examples/carousel/index.html b/site/content/docs/5.3/examples/carousel/index.html index e03f4d764..87150efb0 100644 --- a/site/content/docs/5.3/examples/carousel/index.html +++ b/site/content/docs/5.3/examples/carousel/index.html @@ -21,7 +21,7 @@ extra_css: Link diff --git a/site/content/docs/5.3/examples/cheatsheet-rtl/index.html b/site/content/docs/5.3/examples/cheatsheet-rtl/index.html index 8ffbb5726..9fd24e2e0 100644 --- a/site/content/docs/5.3/examples/cheatsheet-rtl/index.html +++ b/site/content/docs/5.3/examples/cheatsheet-rtl/index.html @@ -1170,7 +1170,7 @@ direction: rtl نشط رابط رابط - معطل + معطل {{< /example >}} @@ -1207,7 +1207,7 @@ direction: rtl رابط {{< /example >}} @@ -1250,7 +1250,7 @@ direction: rtl @@ -1289,7 +1289,7 @@ direction: rtl diff --git a/site/content/docs/5.3/examples/cheatsheet/index.html b/site/content/docs/5.3/examples/cheatsheet/index.html index 7470c4efe..4c96bc0ae 100644 --- a/site/content/docs/5.3/examples/cheatsheet/index.html +++ b/site/content/docs/5.3/examples/cheatsheet/index.html @@ -1169,7 +1169,7 @@ body_class: "bg-body-tertiary" Active Link Link - Disabled + Disabled {{< /example >}} @@ -1206,7 +1206,7 @@ body_class: "bg-body-tertiary" Link {{< /example >}} @@ -1249,7 +1249,7 @@ body_class: "bg-body-tertiary" @@ -1288,7 +1288,7 @@ body_class: "bg-body-tertiary" diff --git a/site/content/docs/5.3/examples/navbar-bottom/index.html b/site/content/docs/5.3/examples/navbar-bottom/index.html index 92eed643a..123cd0bf3 100644 --- a/site/content/docs/5.3/examples/navbar-bottom/index.html +++ b/site/content/docs/5.3/examples/navbar-bottom/index.html @@ -25,7 +25,7 @@ title: Bottom navbar example Link diff --git a/site/content/docs/5.3/examples/navbar-static/index.html b/site/content/docs/5.3/examples/navbar-static/index.html index 2b1b308a0..5624404d6 100644 --- a/site/content/docs/5.3/examples/navbar-static/index.html +++ b/site/content/docs/5.3/examples/navbar-static/index.html @@ -20,7 +20,7 @@ extra_css: Link diff --git a/site/content/docs/5.3/examples/navbars/index.html b/site/content/docs/5.3/examples/navbars/index.html index 4c903bbb9..6ccfab850 100644 --- a/site/content/docs/5.3/examples/navbars/index.html +++ b/site/content/docs/5.3/examples/navbars/index.html @@ -22,7 +22,7 @@ extra_css: Link -- cgit v1.2.3 From 6301ca1ee070b1614ff1fd9fc23b0f1bf869475e Mon Sep 17 00:00:00 2001 From: PARTHIBAN Date: Fri, 9 Jun 2023 20:36:26 +0530 Subject: Update buttons.md --- site/content/docs/5.3/components/buttons.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index ae58fca9a..da380c144 100644 --- a/site/content/docs/5.3/components/buttons.md +++ b/site/content/docs/5.3/components/buttons.md @@ -129,7 +129,7 @@ To cover cases where you have to keep the `href` attribute on a disabled link, t ## Block buttons -Create responsive stacks of full-width, "block buttons" like those in Bootstrap 4 with a mix of our display and gap utilities. By using utilities instead of button specific classes, we have much greater control over spacing, alignment, and responsive behaviors. +Create responsive stacks of full-width, "block buttons" like those in Bootstrap 4 with a mix of our display and gap utilities. By using utilities instead of button-specific classes, we have much greater control over spacing, alignment, and responsive behaviors. {{< example >}}
@@ -156,7 +156,7 @@ You can adjust the width of your block buttons with grid column width classes. F
{{< /example >}} -Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right align the buttons when they're no longer stacked. +Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right-align the buttons when they're no longer stacked. {{< example >}}
@@ -201,8 +201,8 @@ const bsButton = new bootstrap.Button('#myButton') | Method | Description | | --- | --- | | `dispose` | Destroys an element's button. (Removes stored data on the DOM element) | -| `getInstance` | Static method which allows you to get the button instance associated to a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. | -| `getOrCreateInstance` | Static method which returns a button instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)`. | +| `getInstance` | Static method which allows you to get the button instance associated with a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. | +| `getOrCreateInstance` | Static method which returns a button instance associated with a DOM element or creates a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)`. | | `toggle` | Toggles push state. Gives the button the appearance that it has been activated. | {{< /bs-table >}} @@ -227,7 +227,7 @@ As part of Bootstrap's evolving CSS variables approach, buttons now use local CS Each `.btn-*` modifier class updates the appropriate CSS variables to minimize additional CSS rules with our `button-variant()`, `button-outline-variant()`, and `button-size()` mixins. -Here's an example of building a custom `.btn-*` modifier class like we do for the buttons unique to our docs by reassigning Bootstrap's CSS variables with a mixture of our own CSS and Sass variables. +Here's an example of building a custom `.btn-*` modifier class as we do for the buttons unique to our docs by reassigning Bootstrap's CSS variables with a mixture of our own CSS and Sass variables.
-- cgit v1.2.3 From 2c7f888c1ec667119c6a811ed247aaa3cd539fed Mon Sep 17 00:00:00 2001 From: ZhangChengLin <469946668@qq.com> Date: Mon, 5 Jun 2023 23:02:46 +0800 Subject: add a base class style display for toggle buttons --- site/content/docs/5.3/components/buttons.md | 26 +++++++++++++++++++------ site/content/docs/5.3/forms/checks-radios.md | 29 ++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 10 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index da380c144..83a61382a 100644 --- a/site/content/docs/5.3/components/buttons.md +++ b/site/content/docs/5.3/components/buttons.md @@ -178,15 +178,29 @@ Visually, these toggle buttons are identical to the [checkbox toggle buttons]({{ 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. {{< example >}} - - - +

+ + + +

+

+ + + +

{{< /example >}} {{< example >}} -Toggle link -Active toggle link -Disabled toggle link +

+ Toggle link + Active toggle link + Disabled toggle link +

+

+ Toggle link + Active toggle link + Disabled toggle link +

{{< /example >}} ### Methods diff --git a/site/content/docs/5.3/forms/checks-radios.md b/site/content/docs/5.3/forms/checks-radios.md index 13a5091ad..a18ab38c2 100644 --- a/site/content/docs/5.3/forms/checks-radios.md +++ b/site/content/docs/5.3/forms/checks-radios.md @@ -250,18 +250,25 @@ Create button-like checkboxes and radio buttons by using `.btn` styles rather th {{< example >}} -{{< /example >}} -{{< example >}} -{{< /example >}} -{{< example >}} {{< /example >}} +{{< example >}} + + + + + + + + +{{< /example >}} + {{< callout info >}} Visually, these checkbox toggle buttons are identical to the [button plugin toggle buttons]({{< docsref "/components/buttons#button-plugin" >}}). However, they are conveyed differently by assistive technologies: the checkbox toggles will be announced by screen readers as "checked"/"not checked" (since, despite their appearance, they are fundamentally still checkboxes), whereas the button plugin toggle buttons will be announced as "button"/"button pressed". The choice between these two approaches will depend on the type of toggle you are creating, and whether or not the toggle will make sense to users when announced as a checkbox or as an actual button. {{< /callout >}} @@ -282,6 +289,20 @@ Visually, these checkbox toggle buttons are identical to the [button plugin togg {{< /example >}} +{{< example >}} + + + + + + + + + + + +{{< /example >}} + ### Outlined styles Different variants of `.btn`, such at the various outlined styles, are supported. -- cgit v1.2.3 From 42a055c7a8e611523c2d10650a465d75d0bb362b Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Mon, 10 Jul 2023 17:04:21 +0900 Subject: Docs: Fix incorrect `.form-file` on migration guide (#38883) --- site/content/docs/5.3/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.3/migration.md b/site/content/docs/5.3/migration.md index 401b9ac63..ab486c6a5 100644 --- a/site/content/docs/5.3/migration.md +++ b/site/content/docs/5.3/migration.md @@ -498,7 +498,7 @@ Want more information? [Read the v5.1.0 blog post.](https://blog.getbootstrap.co - `.custom-control.custom-radio` is now `.form-check`. - `.custom-control.custom-switch` is now `.form-check.form-switch`. - `.custom-select` is now `.form-select`. - - `.custom-file` and `.form-file` have been replaced by custom styles on top of `.form-control`. + - `.custom-file` and `.form-control-file` have been replaced by custom styles on top of `.form-control`. - `.custom-range` is now `.form-range`. - Dropped native `.form-control-file` and `.form-control-range`. -- cgit v1.2.3 From 8c135169e7ef5a4d6b92b99e21630711d7830963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Sat, 15 Jul 2023 07:45:35 +0200 Subject: Fix tooltip generated markup documentation (#38902) --- site/content/docs/5.3/components/tooltips.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.3/components/tooltips.md b/site/content/docs/5.3/components/tooltips.md index ee98dd058..91adacc7f 100644 --- a/site/content/docs/5.3/components/tooltips.md +++ b/site/content/docs/5.3/components/tooltips.md @@ -165,7 +165,7 @@ The required markup for a tooltip is only a `data` attribute and `title` on the Hover over me - {{< /example >}} @@ -208,9 +206,7 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
  • Dropdown link
  • - - -
    +
    @@ -219,7 +215,7 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
  • Dropdown link
  • -
    +
    @@ -228,7 +224,7 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
  • Dropdown link
  • -
    +
    -- cgit v1.2.3 From b3da789113c8d17bfe4650d8fe6f6cf80436a1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Mon, 17 Jul 2023 05:48:33 +0200 Subject: Fix dark mode rendering of Cheatsheet examples (#38905) --- site/content/docs/5.3/examples/cheatsheet/cheatsheet.css | 15 +++++++-------- .../docs/5.3/examples/cheatsheet/cheatsheet.rtl.css | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/examples/cheatsheet/cheatsheet.css b/site/content/docs/5.3/examples/cheatsheet/cheatsheet.css index e2f99b859..5721a028e 100644 --- a/site/content/docs/5.3/examples/cheatsheet/cheatsheet.css +++ b/site/content/docs/5.3/examples/cheatsheet/cheatsheet.css @@ -12,7 +12,7 @@ body { height: 1em; margin-right: .25rem; content: ""; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%25230d6efd' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E"); background-size: 1em; } @@ -26,29 +26,29 @@ body { padding: .1875rem .5rem; margin-top: .125rem; margin-left: .3125rem; - color: rgba(0, 0, 0, .65); + color: var(--bs-body-color); } .bd-aside a:hover, .bd-aside a:focus { - color: rgba(0, 0, 0, .85); + color: var(--bs-body-color); background-color: rgba(121, 82, 179, .1); } .bd-aside .active { font-weight: 600; - color: rgba(0, 0, 0, .85); + color: var(--bs-body-color); } .bd-aside .btn { padding: .25rem .5rem; font-weight: 600; - color: rgba(0, 0, 0, .65); + color: var(--bs-body-color); } .bd-aside .btn:hover, .bd-aside .btn:focus { - color: rgba(0, 0, 0, .85); + color: var(--bs-body-color); background-color: rgba(121, 82, 179, .1); } @@ -59,7 +59,7 @@ body { .bd-aside .btn::before { width: 1.25em; line-height: 0; - content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ccc' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); transition: transform .35s ease; /* rtl:raw: @@ -149,7 +149,6 @@ body { /* rtl:end:ignore */ z-index: -1; content: ""; - background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1) calc(100% - 3rem), rgba(255, 255, 255, .01)); } .bd-cheatsheet article, diff --git a/site/content/docs/5.3/examples/cheatsheet/cheatsheet.rtl.css b/site/content/docs/5.3/examples/cheatsheet/cheatsheet.rtl.css index e04d84871..416e39fca 100644 --- a/site/content/docs/5.3/examples/cheatsheet/cheatsheet.rtl.css +++ b/site/content/docs/5.3/examples/cheatsheet/cheatsheet.rtl.css @@ -12,7 +12,7 @@ body { height: 1em; margin-left: .25rem; content: ""; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%25230d6efd' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E"); + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2h1a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1H2a2 2 0 0 1 2-2z'/%3E%3Cpath d='M2 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H2z'/%3E%3Cpath fill-rule='evenodd' d='M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z'/%3E%3C/svg%3E"); background-size: 1em; } @@ -26,29 +26,29 @@ body { padding: .1875rem .5rem; margin-top: .125rem; margin-right: .3125rem; - color: rgba(0, 0, 0, .65); + color: var(--bs-body-color); } .bd-aside a:hover, .bd-aside a:focus { - color: rgba(0, 0, 0, .85); + color: var(--bs-body-color); background-color: rgba(121, 82, 179, .1); } .bd-aside .active { font-weight: 600; - color: rgba(0, 0, 0, .85); + color: var(--bs-body-color); } .bd-aside .btn { padding: .25rem .5rem; font-weight: 600; - color: rgba(0, 0, 0, .65); + color: var(--bs-body-color); } .bd-aside .btn:hover, .bd-aside .btn:focus { - color: rgba(0, 0, 0, .85); + color: var(--bs-body-color); background-color: rgba(121, 82, 179, .1); } @@ -59,7 +59,7 @@ body { .bd-aside .btn::before { width: 1.25em; line-height: 0; - content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ccc' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e"); transition: transform .35s ease; transform: rotate(180deg) translateX(-2px); transform-origin: .5em 50%; @@ -142,7 +142,6 @@ body { left: 0; z-index: -1; content: ""; - background-image: linear-gradient(to bottom, rgba(255, 255, 255, 1) calc(100% - 3rem), rgba(255, 255, 255, .01)); } .bd-cheatsheet article, -- cgit v1.2.3 From 101ff73b4ca2c657644342eafc2677c27f711038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Tue, 27 Jun 2023 21:27:48 +0200 Subject: Docs: fix carousel carousel colors of carousel examples in dark mode --- site/content/docs/5.3/examples/carousel-rtl/index.html | 2 +- site/content/docs/5.3/examples/carousel/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'site') diff --git a/site/content/docs/5.3/examples/carousel-rtl/index.html b/site/content/docs/5.3/examples/carousel-rtl/index.html index fbbe7dca9..37d844e6f 100644 --- a/site/content/docs/5.3/examples/carousel-rtl/index.html +++ b/site/content/docs/5.3/examples/carousel-rtl/index.html @@ -36,7 +36,7 @@ extra_css:
    - diff --git a/site/layouts/partials/examples/main.html b/site/layouts/partials/examples/main.html new file mode 100644 index 000000000..902f964b4 --- /dev/null +++ b/site/layouts/partials/examples/main.html @@ -0,0 +1,63 @@ +{{ range $entry := $.Site.Data.examples -}} +
    +

    {{ $entry.category }}

    +

    {{ $entry.description }}

    + {{ if eq $entry.category "RTL" -}} +
    +

    + RTL is still experimental and will evolve with feedback. Spotted something or have an improvement to suggest? +

    +

    Please open an issue.

    +
    + {{ end -}} + {{ range $i, $example := $entry.examples -}} + {{- $len := len $entry.examples -}} + {{ if (eq $i 0) }}
    {{ end }} + {{ if $entry.external -}} +
    + +
    +

    + + {{ $example.name }} + +

    +

    {{ $example.description }}

    +

    + {{- $indexPath := default "index.html" $example.indexPath -}} + {{- $stackBlitzUrl := printf "%s%s%s" (urls.JoinPath "https://stackblitz.com/github/twbs" $example.url) "?file=" ($indexPath | urlquery) }} + + + Edit in StackBlitz + +

    +
    +
    + {{ else -}} + + {{- end }} + {{ if (eq (add $i 1) $len) }}
    {{ end -}} + {{ end -}} +
    +{{ end -}} -- cgit v1.2.3 From f0252f5b2c8a8e22cad5872407059e7615534de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Pereira?= Date: Fri, 5 Apr 2024 19:50:01 +0200 Subject: Add PostCSS-RTLCSS approach to the documentation (#39863) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add PostCSS-RTLCSS approach to the documentation * Format 'PostCSS RTLCSS' without '-' and backticks * Some formatting for consistency in the entire doc * Minor rewording --------- Co-authored-by: Julien Déramond --- site/content/docs/5.3/getting-started/rtl.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'site') diff --git a/site/content/docs/5.3/getting-started/rtl.md b/site/content/docs/5.3/getting-started/rtl.md index 30a1ca527..bf4f617e9 100644 --- a/site/content/docs/5.3/getting-started/rtl.md +++ b/site/content/docs/5.3/getting-started/rtl.md @@ -168,6 +168,16 @@ After running Sass then RTLCSS, each selector in your CSS files will be prepende 3. Nesting styles this way will prevent our `form-validation-state()` mixin from working as intended, thus require you tweak it a bit by yourself. [See #31223](https://github.com/twbs/bootstrap/issues/31223). {{< /callout >}} +Do you want to automate this process and address several edge cases involving both directions within a single stylesheet? Then, consider using [PostCSS RTLCSS](https://github.com/elchininet/postcss-rtlcss) as a [PostCSS](https://github.com/postcss/postcss) plugin to process your source files. PostCSS RTLCSS uses [RTLCSS](https://rtlcss.com) behind the scenes to manage the direction flipping process, but it separates the flipped declarations into rules with a different prefix for LTR and RTL, something that allows you to have both directions within the same stylesheet file. By doing this, you can switch between LTR and RTL orientations by simply changing the `dir` of the page (or even by modifying a specific class if you configure the plugin accordingly). + +{{< callout warning >}} +**Important things to take into account** when using PostCSS RTLCSS to build a combined LTR and RTL implementation: + +1. It is recommended that you add the `dir` attribute to the `html` element. This way, the entire page will be affected when you change the direction. Also, make sure you add the `lang` attribute accordingly. +2. Having a single bundle with both directions will increase the size of the final stylesheet (on average, by 20%-30%): consider some [optimization]({{< docsref "/customize/optimize" >}}). +3. Take into account that PostCSS RTLCSS is not compatible with `/* rtl:remove */` directives because it doesn't remove any CSS rule. You should replace your `/* rtl:remove */`, `/* rtl:begin:remove */` and `/* rtl:end:remove */` directives with `/* rtl:ignore */`, `/* rtl:begin:ignore */` and `/* rtl:end:ignore */` directives respectively. These directives will ignore the rule and will not create an RTL counterpart (same result as the `remove` ones in RTLCSS). +{{< /callout >}} + ## The breadcrumb case The [breadcrumb separator]({{< docsref "/components/breadcrumb#dividers" >}}) is the only case requiring its own brand-new variable— namely `$breadcrumb-divider-flipped` —defaulting to `$breadcrumb-divider`. -- cgit v1.2.3 From bb927451e813081e887397d0d604b45a676348fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 14:57:03 +0300 Subject: Build(deps-dev): Bump stylelint from 16.3.1 to 16.4.0 (#39936) * Build(deps-dev): Bump stylelint from 16.3.1 to 16.4.0 Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.3.1 to 16.4.0. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/16.3.1...16.4.0) --- updated-dependencies: - dependency-name: stylelint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update _content.scss --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: XhmikosR --- site/assets/scss/_content.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'site') diff --git a/site/assets/scss/_content.scss b/site/assets/scss/_content.scss index ba053dfaf..811883b49 100644 --- a/site/assets/scss/_content.scss +++ b/site/assets/scss/_content.scss @@ -73,9 +73,8 @@ } // Prevent breaking of code - // stylelint-disable-next-line selector-max-compound-selectors th, - td:first-child > code { + td:first-child > code { // stylelint-disable-line selector-max-compound-selectors white-space: nowrap; } } -- cgit v1.2.3 From 72d3b6efc4b92e83a4abca6f5bc0cd7e6fd25931 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 2 May 2024 10:19:47 +0300 Subject: docs: migrate to the built-in sitemap template (#39951) --- site/content/404.md | 2 +- site/content/docs/5.3/_index.html | 2 +- site/content/docs/5.3/docsref.md | 2 +- site/content/docs/_index.html | 2 +- site/layouts/sitemap.xml | 12 ------------ 5 files changed, 4 insertions(+), 16 deletions(-) delete mode 100644 site/layouts/sitemap.xml (limited to 'site') diff --git a/site/content/404.md b/site/content/404.md index 14634b216..08359be3e 100644 --- a/site/content/404.md +++ b/site/content/404.md @@ -5,7 +5,7 @@ description: "" url: /404.html robots: noindex,follow sitemap: - exclude: true + disable: true ---
    diff --git a/site/content/docs/5.3/_index.html b/site/content/docs/5.3/_index.html index 1e1800699..f182bde37 100644 --- a/site/content/docs/5.3/_index.html +++ b/site/content/docs/5.3/_index.html @@ -1,6 +1,6 @@ --- layout: redirect sitemap: - exclude: true + disable: true redirect: "/docs/5.3/getting-started/introduction/" --- diff --git a/site/content/docs/5.3/docsref.md b/site/content/docs/5.3/docsref.md index 3f36dd278..5a16470c5 100644 --- a/site/content/docs/5.3/docsref.md +++ b/site/content/docs/5.3/docsref.md @@ -6,7 +6,7 @@ aliases: "/docsref/" toc: true robots: noindex,follow sitemap: - exclude: true + disable: true --- ## Buttons diff --git a/site/content/docs/_index.html b/site/content/docs/_index.html index 1e1800699..f182bde37 100644 --- a/site/content/docs/_index.html +++ b/site/content/docs/_index.html @@ -1,6 +1,6 @@ --- layout: redirect sitemap: - exclude: true + disable: true redirect: "/docs/5.3/getting-started/introduction/" --- diff --git a/site/layouts/sitemap.xml b/site/layouts/sitemap.xml deleted file mode 100644 index 9c626df18..000000000 --- a/site/layouts/sitemap.xml +++ /dev/null @@ -1,12 +0,0 @@ -{{ printf "" | safeHTML }} - - {{- range where .Data.Pages "Params.sitemap.exclude" "ne" true -}}{{ if .Permalink }} - - {{ .Permalink }}{{ if not .Lastmod.IsZero }} - {{ safeHTML (.Lastmod.Format "2006-01-02T15:04:05-07:00") }}{{ end }}{{ with .Sitemap.ChangeFreq }} - {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} - {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} - {{ end }} - {{ end }} - {{ end }}{{ end }} - -- cgit v1.2.3 From 7ff271bd8a8386b09a9eca78ea998356bc133ca8 Mon Sep 17 00:00:00 2001 From: Hannah Issermann Date: Sat, 25 May 2024 08:02:29 +0200 Subject: docs: add Accordion component in the JS components section (#39980) --- site/content/docs/5.3/getting-started/introduction.md | 1 + 1 file changed, 1 insertion(+) (limited to 'site') diff --git a/site/content/docs/5.3/getting-started/introduction.md b/site/content/docs/5.3/getting-started/introduction.md index b0f7dabc5..b76b2d47d 100644 --- a/site/content/docs/5.3/getting-started/introduction.md +++ b/site/content/docs/5.3/getting-started/introduction.md @@ -83,6 +83,7 @@ You can also use the CDN to fetch any of our [additional builds listed in the Co Curious which components explicitly require our JavaScript and Popper? If you're at all unsure about the general page structure, keep reading for an example page template. +- Accordions for extending our Collapse plugin - Alerts for dismissing - Buttons for toggling states and checkbox/radio functionality - Carousel for all slide behaviors, controls, and indicators -- cgit v1.2.3 From d6731ea2e6ffa4da1e4b74ac29442679ea9d467d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 29 May 2024 08:35:16 +0200 Subject: docs: add missing `data-bs-theme="light"` in navbars color schemes markup (#40504) --- site/content/docs/5.3/components/navbar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'site') diff --git a/site/content/docs/5.3/components/navbar.md b/site/content/docs/5.3/components/navbar.md index ab6c2305c..4b46eb095 100644 --- a/site/content/docs/5.3/components/navbar.md +++ b/site/content/docs/5.3/components/navbar.md @@ -428,7 +428,7 @@ Navbar themes are easier than ever thanks to Bootstrap's combination of Sass and -