Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <markd.otto@gmail.com>2022-04-19 06:56:18 +0300
committerGitHub <noreply@github.com>2022-04-19 06:56:18 +0300
commit3362c8cf13cc3610a6e0ac1efc673f7f8c74ac08 (patch)
tree7ad4d92b2cff116ca28dd5479d2272971fea0c44
parent3990ff04a00f2768b768e1c852594e3a365b9c61 (diff)
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
-rw-r--r--site/assets/scss/_component-examples.scss12
-rw-r--r--site/assets/scss/_masthead.scss6
-rw-r--r--site/assets/scss/_syntax.scss2
-rw-r--r--site/content/docs/5.1/components/offcanvas.md22
-rw-r--r--site/content/docs/5.1/migration.md32
5 files changed, 30 insertions, 44 deletions
diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss
index 701682d204..73ffe2f8ef 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 42ad0f3853..4bb356e103 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 662f70dc4d..487550bfd3 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 6ad9b6e893..3abdc3acf0 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.
-<div class="bd-example">
- <button class="btn btn-primary d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasResponsive" aria-controls="offcanvasResponsive">Toggle offcanvas</button>
-
- <div class="alert alert-info d-none d-lg-block">Resize your browser to show the responsive offcanvas toggle.</div>
-
- <div class="offcanvas-lg offcanvas-end" tabindex="-1" id="offcanvasResponsive" aria-labelledby="offcanvasResponsiveLabel">
- <div class="offcanvas-header">
- <h5 class="offcanvas-title" id="offcanvasResponsiveLabel">Responsive offcanvas</h5>
- <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
- </div>
- <div class="offcanvas-body">
- <p class="mb-0">This is content within an <code>.offcanvas-lg</code>.</p>
- </div>
- </div>
-</div>
+{{< example >}}
+<button class="btn btn-primary d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasResponsive" aria-controls="offcanvasResponsive">Toggle offcanvas</button>
-```html
-<button class="btn btn-primary" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasResponsive" aria-controls="offcanvasResponsive">Toggle offcanvas</button>
+<div class="alert alert-info d-none d-lg-block">Resize your browser to show the responsive offcanvas toggle.</div>
<div class="offcanvas-lg offcanvas-end" tabindex="-1" id="offcanvasResponsive" aria-labelledby="offcanvasResponsiveLabel">
<div class="offcanvas-header">
@@ -171,7 +157,7 @@ Responsive offcanvas classes hide content outside the viewport from a specified
<p class="mb-0">This is content within an <code>.offcanvas-lg</code>.</p>
</div>
</div>
-```
+{{< /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 baba2dffab..21b965e567 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.