🌐 AI搜索 & 代理 主页
Skip to content

Commit c7bc62c

Browse files
authored
fix(docs): broken links and sync layout docs with Bootstrap's (#4261)
* fix(docs): broken links and sync layout docs with Bootstrap's * Update CHANGELOG.md * Update CHANGELOG.md
1 parent b222c7c commit c7bc62c

File tree

3 files changed

+42
-38
lines changed

3 files changed

+42
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ Released: (2019-02-14)
20322032
- **table:** add support for transitions on tbody element
20332033
([#1821](https://github.com/bootstrap-vue/bootstrap-vue/issues/1821))
20342034
([#2450](https://github.com/bootstrap-vue/bootstrap-vue/issues/2450))
2035-
([91514af](https://github.com/bootstrap-vue/bootstrap-vue/commit/91514af))
2035+
([91514af](https://github.com/bootstrap-vue/bootstrap-vue/commit/91514af445221286ef0bc55985556d58e3c54fdc))
20362036
- **table:** add table row middle click (auxclicked) event
20372037
([#2425](https://github.com/bootstrap-vue/bootstrap-vue/issues/2425))
20382038
([23250a2](https://github.com/bootstrap-vue/bootstrap-vue/commit/23250a2))
@@ -2261,7 +2261,7 @@ Released: 2018-04-01
22612261
### Bug Fixes v2.0.0-rc.4
22622262

22632263
- **build:** don't exclude lodash.get
2264-
([543c3c2](https://github.com/bootstrap-vue/bootstrap-vue/commit/543c3c2))
2264+
([543c3c2](https://github.com/bootstrap-vue/bootstrap-vue/commit/543c3c2f9aeccffb03c571aeea93333774243ab3))
22652265
- **card:** pass children instead of default prop to sub-components
22662266
([63b35e3](https://github.com/bootstrap-vue/bootstrap-vue/commit/63b35e3))
22672267

src/components/layout/README.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ functional layout components.
1111

1212
## How it works
1313

14-
Bootstrap's grid system uses a series of containers, rows, and columns to lay out and align content.
15-
It's built with flexbox and is fully responsive. Below is an example and an in-depth look at how the
16-
grid comes together.
14+
Bootstrap's grid system uses a series of containers, rows, and columns to layout and align content.
15+
It's built with
16+
[flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox)
17+
and is fully responsive. Below is an example and an in-depth look at how the grid comes together.
1718

1819
```html
1920
<b-container class="bv-example-row">
@@ -29,17 +30,18 @@ grid comes together.
2930

3031
The above example creates three equal-width columns on small, medium, large, and extra large devices
3132
using Bootstrap v4's predefined grid classes. Those columns are centered in the page with the parent
32-
.container.
33-
34-
Here's how it works:
35-
36-
- Containers provide a means to center your site's contents. Use `<b-container>` for fixed width or
37-
`<b-container fluid>` for full width.
38-
- Rows are horizontal groups of columns that ensure your columns are lined up properly. We use the
39-
negative margin method on `<b-row>` to ensure all your content is aligned properly down the left
40-
side.
41-
- Content should be placed within `<b-col>` columns, and only columns may be immediate children of
42-
`<b-row>`.
33+
`.container`.
34+
35+
Breaking it down, here's how it works:
36+
37+
- Containers provide a means to center and horizontally pad your site's contents. Use
38+
`<b-container>` for a responsive pixel width or `<b-container fluid>` for `width: 100%` across all
39+
viewport and device sizes.
40+
- Rows are wrappers for columns. Each column has horizontal `padding` (called a gutter) for
41+
controlling the space between them. This `padding` is then counteracted on the rows with negative
42+
margins. This way, all the content in your columns is visually aligned down the left side.
43+
- In a grid layout, content must be placed within columns and only columns may be immediate children
44+
of rows.
4345
- Thanks to flexbox, grid columns without a set width will automatically layout with equal widths.
4446
For example, four instances of `<b-col sm="auto">` will each automatically be 25% wide for small
4547
breakpoints.
@@ -50,20 +52,21 @@ Here's how it works:
5052
possible 12 per row, at the various breakpoints. So, if you want three equal-width columns at
5153
breakpoint `sm`, you can use `<b-col sm="4">`. the special value `auto` can be used to take up the
5254
remaining available column space in a row.
53-
- Column widths, internally, are set in percentages, so they're always fluid and sized relative to
54-
their parent element.
55-
- Columns have horizontal padding to create the gutters between individual columns, however, you can
56-
remove the margin from `<b-row>` and padding from `<b-col>` by setting the `no-gutters` prop on
57-
`<b-row>`.
58-
- There are five grid tiers, one for each responsive breakpoint: all breakpoints (extra small),
59-
small, medium, large, and extra large.
60-
- Grid tiers are based on minimum widths, meaning they apply to that one tier and all those above it
61-
(e.g., `<b-col sm="4">` applies to small, medium, large, and extra large devices).
55+
- Column `width`s are set in percentages, so they're always fluid and sized relative to their parent
56+
element.
57+
- Columns have horizontal `padding` to create the gutters between individual columns, however, you
58+
can remove the `margin` from `<b-row>` and `padding` from `<b-col>` by setting the `no-gutters`
59+
prop on `<b-row>`.
60+
- To make the grid responsive, there are five grid breakpoints, one for each responsive breakpoint:
61+
all breakpoints (extra small), small, medium, large, and extra large.
62+
- Grid breakpoints are based on minimum width media queries, meaning **they apply to that one
63+
breakpoint and all those above it** (e.g., `<b-col sm="4">` applies to small, medium, large, and
64+
extra large devices, but not the first `xs` breakpoint).
6265
- You can use predefined grid classes or Sass mixins for more semantic markup.
6366

6467
Be aware of the limitations and [bugs around flexbox](https://github.com/philipwalton/flexbugs),
6568
like the
66-
[inability to use some HTML elements as flex containers](https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers).
69+
[inability to use some HTML elements as flex containers](https://github.com/philipwalton/flexbugs#flexbug-9).
6770

6871
## Containers `<b-container>`
6972

@@ -109,7 +112,7 @@ the class `row` applied to it, or - in the case of [forms](/docs/components/form
109112

110113
## Grid options
111114

112-
While Bootstrap uses `ems` or `rems` for defining most sizes, `px`s are used for grid breakpoints
115+
While Bootstrap uses `em`s or `rem`s for defining most sizes, `px`s are used for grid breakpoints
113116
and container widths. This is because the viewport width is in pixels and does not change with the
114117
[font size](https://drafts.csswg.org/mediaqueries-3/#units).
115118

@@ -198,8 +201,8 @@ like `<b-col sm="6">`.
198201

199202
### Equal-width columns
200203

201-
For example, here are two grid layouts that apply to every device and viewport, from xs to xl. Add
202-
any number of unit-less classes for each breakpoint you need and every column will be the same
204+
For example, here are two grid layouts that apply to every device and viewport, from `xs` to `xl`.
205+
Add any number of unit-less classes for each breakpoint you need and every column will be the same
203206
width.
204207

205208
```html
@@ -219,15 +222,16 @@ width.
219222
<!-- b-grid-equal-width.vue -->
220223
```
221224

222-
Equal-width columns can be broken into multiple lines, but there is a
223-
[Safari flexbox bug](https://github.com/philipwalton/flexbugs#11-min-and-max-size-declarations-are-ignored-when-wrapping-flex-items)
224-
that prevents this from working without an explicit flex-basis or border. Our example works thanks
225-
to the border being set; you can do the same with `.col { border: 1px solid transparent; }`.
226-
Alternatively, you can set the flex-basis to the width of the column (e.g.,
227-
`.col { flex: 1 0 50%; }`).
225+
### Equal-width multi-line
226+
227+
Create equal-width columns that span multiple lines by inserting a `.w-100` where you want the
228+
columns to break to a new line. Make the breaks responsive by mixing `.w-100` with some
229+
[responsive display utilities](https://getbootstrap.com/docs/4.3/utilities/display/).
228230

229-
Both these fixes have been documented in a
230-
[reduced test case outside Bootstrap](https://output.jsbin.com/micohor).
231+
There was a [Safari flexbox bug](https://github.com/philipwalton/flexbugs#flexbug-11) that prevented
232+
this from working without an explicit `flex-basis` or `border`. There are workarounds for older
233+
browser versions, but they shouldn't be necessary if your target browsers don't fall into the buggy
234+
versions.
231235

232236
```html
233237
<b-container class="bv-example-row">

src/components/table/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ sorts _before_ `z`) or Swedish set `sort-compare-locale="sv"` (in Swedish, `ä`
19321932
**Notes:**
19331933

19341934
- Refer to
1935-
[MDN `String.prototype.localeCompare()` documentation](https://developer.mozilla.org/enUS/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
1935+
[MDN `String.prototype.localeCompare()` documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
19361936
for details on the options object property values.
19371937
- Refer to
19381938
[MDN locales documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument)

0 commit comments

Comments
 (0)