Skip to content

Commit 3f649e3

Browse files
mdojulien-deramond
andauthored
v6: More utilities API, docs, tests (#42381)
* Utilities API and class improvements * Expand utility API test coverage * Update utilities API and border-radius docs * Fix bundlewatch * Introduce `@mixin generate-utilities-loop()` * Add text wrapping utilities in Sass utilities API in the docs * Copy updates, links, callout for postcss prefix, fix a border-radius * inline warning * error over warn * Fix bundlewatch * more copy edits * fix layout and headings * lint --------- Co-authored-by: Julien Déramond <juderamond@gmail.com>
1 parent 853c661 commit 3f649e3

12 files changed

Lines changed: 702 additions & 295 deletions

File tree

.bundlewatch.config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
},
1919
{
2020
"path": "./dist/css/bootstrap-utilities.css",
21-
"maxSize": "17.75 kB"
21+
"maxSize": "18.0 kB"
2222
},
2323
{
2424
"path": "./dist/css/bootstrap-utilities.min.css",
2525
"maxSize": "16.75 kB"
2626
},
2727
{
2828
"path": "./dist/css/bootstrap.css",
29-
"maxSize": "48.25 kB"
29+
"maxSize": "48.5 kB"
3030
},
3131
{
3232
"path": "./dist/css/bootstrap.min.css",
33-
"maxSize": "45.0 kB"
33+
"maxSize": "45.25 kB"
3434
},
3535
{
3636
"path": "./dist/js/bootstrap.bundle.js",

scss/_utilities.scss

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ $utilities: map.merge(
128128
values: $position-values
129129
),
130130
"start": (
131-
property: left,
131+
property: inset-inline-start,
132132
class: start,
133133
values: $position-values
134134
),
135135
"end": (
136-
property: right,
136+
property: inset-inline-end,
137137
class: end,
138138
values: $position-values
139139
),
@@ -188,13 +188,15 @@ $utilities: map.merge(
188188
)
189189
),
190190
"border-y": (
191+
class: border-y,
191192
property: border-block,
192193
values: (
193194
null: var(--border-width) var(--border-style) var(--border-color),
194195
0: 0,
195196
)
196197
),
197198
"border-x": (
199+
class: border-x,
198200
property: border-inline,
199201
values: (
200202
null: var(--border-width) var(--border-style) var(--border-color),
@@ -375,8 +377,8 @@ $utilities: map.merge(
375377
responsive: true,
376378
property: justify-self,
377379
values: (
378-
start: flex-start,
379-
end: flex-end,
380+
start: start,
381+
end: end,
380382
center: center,
381383
)
382384
),
@@ -687,19 +689,13 @@ $utilities: map.merge(
687689
values: lowercase uppercase capitalize
688690
),
689691
// scss-docs-end utils-text-transform
690-
// "white-space": (
691-
// property: white-space,
692-
// class: text,
693-
// values: (
694-
// wrap: normal,
695-
// nowrap: nowrap,
696-
// )
697-
// ),
692+
// scss-docs-start utils-text-wrap
698693
"text-wrap": (
699-
property: white-space,
694+
property: text-wrap,
700695
class: text,
701696
values: wrap nowrap balance pretty,
702697
),
698+
// scss-docs-end utils-text-wrap
703699
// scss-docs-start utils-text-break
704700
"word-wrap": (
705701
property: word-wrap word-break,
@@ -709,12 +705,6 @@ $utilities: map.merge(
709705
// scss-docs-end utils-text-break
710706
// scss-docs-end utils-text
711707
// scss-docs-start utils-color
712-
// "color-attr": (
713-
// selector: "attr-includes",
714-
// class: "fg-",
715-
// property: color,
716-
// values: var(--fg),
717-
// ),
718708
"fg": (
719709
property: (
720710
"--fg": null,
@@ -870,7 +860,10 @@ $utilities: map.merge(
870860
// scss-docs-end utils-interaction
871861
// scss-docs-start utils-border-radius
872862
"border-radius": (
873-
property: border-radius,
863+
property: (
864+
"--rounded-size": null,
865+
"border-radius": var(--rounded-size)
866+
),
874867
class: rounded,
875868
values: map.merge(
876869
$radii,
@@ -881,49 +874,61 @@ $utilities: map.merge(
881874
)
882875
)
883876
),
877+
"rounded-size": (
878+
property: --rounded-size,
879+
class: rounded-size,
880+
values: map.merge(
881+
$radii,
882+
(
883+
null: map.get($radii, 5),
884+
circle: 50%,
885+
pill: var(--radius-pill)
886+
)
887+
)
888+
),
884889
"rounded-top": (
885890
property: border-start-start-radius border-start-end-radius,
886891
class: rounded-top,
887892
values: map.merge(
888893
$radii,
889894
(
890-
null: map.get($radii, 5),
895+
null: var(--rounded-size, var(--radius-5)),
891896
circle: 50%,
892897
pill: var(--radius-pill)
893898
)
894899
)
895900
),
896901
"rounded-end": (
897-
property: border-end-end-radius border-end-start-radius,
902+
property: border-start-end-radius border-end-end-radius,
898903
class: rounded-end,
899904
values: map.merge(
900905
$radii,
901906
(
902-
null: map.get($radii, 5),
907+
null: var(--rounded-size, var(--radius-5)),
903908
circle: 50%,
904909
pill: var(--radius-pill)
905910
)
906911
)
907912
),
908913
"rounded-bottom": (
909-
property: border-end-end-radius border-end-start-radius,
914+
property: border-end-start-radius border-end-end-radius,
910915
class: rounded-bottom,
911916
values: map.merge(
912917
$radii,
913918
(
914-
null: map.get($radii, 5),
919+
null: var(--rounded-size, var(--radius-5)),
915920
circle: 50%,
916921
pill: var(--radius-pill)
917922
)
918923
)
919924
),
920925
"rounded-start": (
921-
property: border-start-start-radius border-start-end-radius,
926+
property: border-start-start-radius border-end-start-radius,
922927
class: rounded-start,
923928
values: map.merge(
924929
$radii,
925930
(
926-
null: map.get($radii, 5),
931+
null: var(--rounded-size, var(--radius-5)),
927932
circle: 50%,
928933
pill: var(--radius-pill)
929934
)

0 commit comments

Comments
 (0)