You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/docs/5.0/utilities/api.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -289,6 +289,57 @@ $utilities: map-merge(
289
289
);
290
290
```
291
291
292
+
#### Enable responsive
293
+
294
+
You can enable responsive classes for an existing set of utilities that are not currently responsive by default. For example, to make the `border` classes responsive:
295
+
296
+
```scss
297
+
@import"bootstrap/scss/functions";
298
+
@import"bootstrap/scss/variables";
299
+
@import"bootstrap/scss/utilities";
300
+
301
+
$utilities: map-merge(
302
+
$utilities, (
303
+
"border": map-merge(
304
+
map-get($utilities, "border"),
305
+
( responsive: true ),
306
+
),
307
+
)
308
+
);
309
+
```
310
+
311
+
This will now generate responsive variations of `.border` and `.border-0` for each breakpoint. Your generated CSS will look like this:
312
+
313
+
```css
314
+
.border { ... }
315
+
.border-0 { ... }
316
+
317
+
@media (min-width: 576px) {
318
+
.border-sm { ... }
319
+
.border-sm-0 { ... }
320
+
}
321
+
322
+
@media (min-width: 768px) {
323
+
.border-md { ... }
324
+
.border-md-0 { ... }
325
+
}
326
+
327
+
@media (min-width: 992px) {
328
+
.border-lg { ... }
329
+
.border-lg-0 { ... }
330
+
}
331
+
332
+
@media (min-width: 1200px) {
333
+
.border-xl { ... }
334
+
.border-xl-0 { ... }
335
+
}
336
+
337
+
@media (min-width: 1400px) {
338
+
.border-xxl { ... }
339
+
.border-xxl-0 { ... }
340
+
}
341
+
```
342
+
292
343
#### Rename utilities
293
344
294
345
Missing v4 utilities, or used to another naming convention? The utilities API can be used to override the resulting `class` of a given utility—for example, to rename `.ms-*` utilities to oldish `.ml-*`:
0 commit comments