Skip to content

Commit e3db84b

Browse files
committed
docs: update content
1 parent aa270b0 commit e3db84b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/content/4.0/layout/css-grid.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ With Bootstrap 5, we've added the option to enable a separate grid system that's
2222

2323
- **Replace `.col-*` classes with `.g-col-*` classes.** This is because our CSS Grid columns use the `grid-column` property instead of `width`.
2424

25-
- **Columns and gutter sizes are set via CSS variables.** Set these on the parent `.grid` and customize however you want, inline or in a stylesheet, with `--bs-columns` and `--bs-gap`.
25+
- **Columns and gutter sizes are set via CSS variables.** Set these on the parent `.grid` and customize however you want, inline or in a stylesheet, with `--cui-columns` and `--cui-gap`.
2626

2727
In the future, Bootstrap will likely shift to a hybrid solution as the `gap` property has achieved nearly full browser support for flexbox.
2828

@@ -36,7 +36,7 @@ Compared to the default grid system:
3636

3737
- As such, unlike `.row`s, `.grid`s have no negative margins and margin utilities cannot be used to change the grid gutters. Grid gaps are applied horizontally and vertically by default. See the [customizing section](#customizing) for more details.
3838

39-
- Inline and custom styles should be viewed as replacements for modifier classes (e.g., `style="--bs-columns: 3;"` vs `class="row-cols-3"`).
39+
- Inline and custom styles should be viewed as replacements for modifier classes (e.g., `style="--cui-columns: 3;"` vs `class="row-cols-3"`).
4040

4141
- Nesting works similarly, but may require you to reset your column counts on each instance of a nested `.grid`. See the [nesting section](#nesting) for details.
4242

@@ -139,15 +139,15 @@ This behavior can be mixed with grid column classes.
139139

140140
Similar to our default grid system, our CSS Grid allows for easy nesting of `.grid`s. However, unlike the default, this grid inherits changes in the rows, columns, and gaps. Consider the example below:
141141

142-
- We override the default number of columns with a local CSS variable: `--bs-columns: 3`.
142+
- We override the default number of columns with a local CSS variable: `--cui-columns: 3`.
143143
- In the first auto-column, the column count is inherited and each column is one-third of the available width.
144144
- In the second auto-column, we've reset the column count on the nested `.grid` to 12 (our default).
145145
- The third auto-column has no nested content.
146146

147147
In practice this allows for more complex and custom layouts when compared to our default grid system.
148148

149149
{{< example class="bd-example-cssgrid" >}}
150-
<div class="grid" style="--bs-columns: 3;">
150+
<div class="grid" style="--cui-columns: 3;">
151151
<div>
152152
First auto-column
153153
<div class="grid">
@@ -157,7 +157,7 @@ In practice this allows for more complex and custom layouts when compared to our
157157
</div>
158158
<div>
159159
Second auto-column
160-
<div class="grid" style="--bs-columns: 12;">
160+
<div class="grid" style="--cui-columns: 12;">
161161
<div class="g-col-6">6 of 12</div>
162162
<div class="g-col-4">4 of 12</div>
163163
<div class="g-col-2">2 of 12</div>
@@ -174,19 +174,19 @@ Customize the number of columns, the number of rows, and the width of the gaps w
174174
{{< bs-table "table" >}}
175175
| Variable | Fallback value | Description |
176176
| --- | --- | --- |
177-
| `--bs-rows` | `1` | The number of rows in your grid template |
178-
| `--bs-columns` | `12` | The number of columns in your grid template |
179-
| `--bs-gap` | `1.5rem` | The size of the gap between columns (vertical and horizontal) |
177+
| `--cui-rows` | `1` | The number of rows in your grid template |
178+
| `--cui-columns` | `12` | The number of columns in your grid template |
179+
| `--cui-gap` | `1.5rem` | The size of the gap between columns (vertical and horizontal) |
180180
{{< /bs-table >}}
181181

182-
These CSS variables have no default value; instead, they apply fallback values that are used _until_ a local instance is provided. For example, we use `var(--bs-rows, 1)` for our CSS Grid rows, which ignores `--bs-rows` because that hasn't been set anywhere yet. Once it is, the `.grid` instance will use that value instead of the fallback value of `1`.
182+
These CSS variables have no default value; instead, they apply fallback values that are used _until_ a local instance is provided. For example, we use `var(--cui-rows, 1)` for our CSS Grid rows, which ignores `--cui-rows` because that hasn't been set anywhere yet. Once it is, the `.grid` instance will use that value instead of the fallback value of `1`.
183183

184184
### No grid classes
185185

186186
Immediate children elements of `.grid` are grid items, so they'll be sized without explicitly adding a `.g-col` class.
187187

188188
{{< example class="bd-example-cssgrid" >}}
189-
<div class="grid" style="--bs-columns: 3;">
189+
<div class="grid" style="--cui-columns: 3;">
190190
<div>Auto-column</div>
191191
<div>Auto-column</div>
192192
<div>Auto-column</div>
@@ -198,14 +198,14 @@ Immediate children elements of `.grid` are grid items, so they'll be sized witho
198198
Adjust the number of columns and the gap.
199199

200200
{{< example class="bd-example-cssgrid" >}}
201-
<div class="grid" style="--bs-columns: 4; --bs-gap: 5rem;">
201+
<div class="grid" style="--cui-columns: 4; --cui-gap: 5rem;">
202202
<div class="g-col-2">.g-col-2</div>
203203
<div class="g-col-2">.g-col-2</div>
204204
</div>
205205
{{< /example >}}
206206

207207
{{< example class="bd-example-cssgrid" >}}
208-
<div class="grid" style="--bs-columns: 10; --bs-gap: 1rem;">
208+
<div class="grid" style="--cui-columns: 10; --cui-gap: 1rem;">
209209
<div class="g-col-6">.g-col-6</div>
210210
<div class="g-col-4">.g-col-4</div>
211211
</div>
@@ -216,7 +216,7 @@ Adjust the number of columns and the gap.
216216
Adding more rows and changing the placement of columns:
217217

218218
{{< example class="bd-example-cssgrid" >}}
219-
<div class="grid" style="--bs-rows: 3; --bs-columns: 3;">
219+
<div class="grid" style="--cui-rows: 3; --cui-columns: 3;">
220220
<div>Auto-column</div>
221221
<div class="g-start-2" style="grid-row: 2">Auto-column</div>
222222
<div class="g-start-3" style="grid-row: 3">Auto-column</div>
@@ -237,10 +237,10 @@ Change the vertical gaps only by modifying the `row-gap`. Note that we use `gap`
237237
</div>
238238
{{< /example >}}
239239

240-
Because of that, you can have different vertical and horizontal `gap`s, which can take a single value (all sides) or a pair of values (vertical and horizontal). This can be applied with an inline style for `gap`, or with our `--bs-gap` CSS variable.
240+
Because of that, you can have different vertical and horizontal `gap`s, which can take a single value (all sides) or a pair of values (vertical and horizontal). This can be applied with an inline style for `gap`, or with our `--cui-gap` CSS variable.
241241

242242
{{< example class="bd-example-cssgrid" >}}
243-
<div class="grid" style="--bs-gap: .25rem 1rem;">
243+
<div class="grid" style="--cui-gap: .25rem 1rem;">
244244
<div class="g-col-6">.g-col-6</div>
245245
<div class="g-col-6">.g-col-6</div>
246246

@@ -259,7 +259,7 @@ One limitation of the CSS Grid is that our default classes are still generated b
259259
For example, you can increase the column count and change the gap size, and then size your "columns" with a mix of inline styles and predefined CSS Grid column classes (e.g., `.g-col-4`).
260260

261261
{{< example class="bd-example-cssgrid" >}}
262-
<div class="grid" style="--bs-columns: 18; --bs-gap: .5rem;">
262+
<div class="grid" style="--cui-columns: 18; --cui-gap: .5rem;">
263263
<div style="grid-column: span 14;">14 columns</div>
264264
<div class="g-col-4">.g-col-4</div>
265265
</div>

0 commit comments

Comments
 (0)