Skip to content

Commit 15c1324

Browse files
julien-deramondTobiGrlouismaximepiton
authored
Docs: precise how to add new .order-* classes in 'Layout > Columns' (#40821)
Co-authored-by: Tobi <[email protected]> Co-authored-by: Louis-Maxime Piton <[email protected]>
1 parent fee9dc2 commit 15c1324

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

site/content/docs/5.3/layout/columns.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ You may also apply this break at specific breakpoints with our [responsive displ
203203

204204
### Order classes
205205

206-
Use `.order-` classes for controlling the **visual order** of your content. These classes are responsive, so you can set the `order` by breakpoint (e.g., `.order-1.order-md-2`). Includes support for `1` through `5` across all six grid tiers. If you need more `.order-*` classes, you can modify the default number via Sass variable.
206+
Use `.order-` classes for controlling the **visual order** of your content. These classes are responsive, so you can set the `order` by breakpoint (e.g., `.order-1.order-md-2`). Includes support for `1` through `5` across all six grid tiers.
207207

208208
{{< example class="bd-example-row" >}}
209209
<div class="container text-center">
@@ -239,6 +239,28 @@ There are also responsive `.order-first` and `.order-last` classes that change t
239239
</div>
240240
{{< /example >}}
241241

242+
If you need more `.order-*` classes, you can add new ones by modifying our `$utilities` Sass map. [Read our Sass maps and loops docs]({{< docsref "/customize/sass#maps-and-loops" >}}) or [our Modify utilities docs]({{< docsref "/utilities/api#modify-utilities" >}}) for details.
243+
244+
```scss
245+
$utilities: map-merge(
246+
$utilities,
247+
(
248+
"order": map-merge(
249+
map-get($utilities, "order"),
250+
(
251+
values: map-merge(
252+
map-get(map-get($utilities, "order"), "values"),
253+
(
254+
6: 6, // Add a new `.order-{breakpoint}-6` utility
255+
last: 7 // Change the `.order-{breakpoint}-last` utility to use the next number
256+
)
257+
),
258+
),
259+
),
260+
)
261+
);
262+
```
263+
242264
### Offsetting columns
243265

244266
You can offset grid columns in two ways: our responsive `.offset-` grid classes and our [margin utilities]({{< docsref "/utilities/spacing" >}}). Grid classes are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable.

0 commit comments

Comments
 (0)