Skip to content

Commit 2d58738

Browse files
committed
Add safe alignment utilities
1 parent c01b825 commit 2d58738

File tree

3 files changed

+135
-2
lines changed

3 files changed

+135
-2
lines changed

packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap

+18
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,9 @@ exports[`getClassList 1`] = `
16821682
"content-baseline",
16831683
"content-between",
16841684
"content-center",
1685+
"content-center-safe",
16851686
"content-end",
1687+
"content-end-safe",
16861688
"content-evenly",
16871689
"content-none",
16881690
"content-normal",
@@ -2375,24 +2377,32 @@ exports[`getClassList 1`] = `
23752377
"italic",
23762378
"items-baseline",
23772379
"items-center",
2380+
"items-center-safe",
23782381
"items-end",
2382+
"items-end-safe",
23792383
"items-start",
23802384
"items-stretch",
23812385
"justify-around",
23822386
"justify-baseline",
23832387
"justify-between",
23842388
"justify-center",
2389+
"justify-center-safe",
23852390
"justify-end",
2391+
"justify-end-safe",
23862392
"justify-evenly",
23872393
"justify-items-center",
2394+
"justify-items-center-safe",
23882395
"justify-items-end",
2396+
"justify-items-end-safe",
23892397
"justify-items-normal",
23902398
"justify-items-start",
23912399
"justify-items-stretch",
23922400
"justify-normal",
23932401
"justify-self-auto",
23942402
"justify-self-center",
2403+
"justify-self-center-safe",
23952404
"justify-self-end",
2405+
"justify-self-end-safe",
23962406
"justify-self-start",
23972407
"justify-self-stretch",
23982408
"justify-start",
@@ -2756,18 +2766,24 @@ exports[`getClassList 1`] = `
27562766
"place-content-baseline",
27572767
"place-content-between",
27582768
"place-content-center",
2769+
"place-content-center-safe",
27592770
"place-content-end",
2771+
"place-content-end-safe",
27602772
"place-content-evenly",
27612773
"place-content-start",
27622774
"place-content-stretch",
27632775
"place-items-baseline",
27642776
"place-items-center",
2777+
"place-items-center-safe",
27652778
"place-items-end",
2779+
"place-items-end-safe",
27662780
"place-items-start",
27672781
"place-items-stretch",
27682782
"place-self-auto",
27692783
"place-self-center",
2784+
"place-self-center-safe",
27702785
"place-self-end",
2786+
"place-self-end-safe",
27712787
"place-self-start",
27722788
"place-self-stretch",
27732789
"placeholder-current",
@@ -3261,7 +3277,9 @@ exports[`getClassList 1`] = `
32613277
"self-auto",
32623278
"self-baseline",
32633279
"self-center",
3280+
"self-center-safe",
32643281
"self-end",
3282+
"self-end-safe",
32653283
"self-start",
32663284
"self-stretch",
32673285
"sepia",

packages/tailwindcss/src/utilities.test.ts

+99-2
Original file line numberDiff line numberDiff line change
@@ -6514,8 +6514,10 @@ test('place-content', async () => {
65146514
expect(
65156515
await run([
65166516
'place-content-center',
6517+
'place-content-center-safe',
65176518
'place-content-start',
65186519
'place-content-end',
6520+
'place-content-end-safe',
65196521
'place-content-between',
65206522
'place-content-around',
65216523
'place-content-evenly',
@@ -6539,10 +6541,18 @@ test('place-content', async () => {
65396541
place-content: center;
65406542
}
65416543
6544+
.place-content-center-safe {
6545+
place-content: safe center;
6546+
}
6547+
65426548
.place-content-end {
65436549
place-content: end;
65446550
}
65456551
6552+
.place-content-end-safe {
6553+
place-content: safe end;
6554+
}
6555+
65466556
.place-content-evenly {
65476557
place-content: evenly;
65486558
}
@@ -6583,7 +6593,9 @@ test('place-items', async () => {
65836593
await run([
65846594
'place-items-start',
65856595
'place-items-end',
6596+
'place-items-end-safe',
65866597
'place-items-center',
6598+
'place-items-center-safe',
65876599
'place-items-baseline',
65886600
'place-items-stretch',
65896601
]),
@@ -6596,10 +6608,18 @@ test('place-items', async () => {
65966608
place-items: center;
65976609
}
65986610
6611+
.place-items-center-safe {
6612+
place-items: safe center;
6613+
}
6614+
65996615
.place-items-end {
66006616
place-items: end;
66016617
}
66026618
6619+
.place-items-end-safe {
6620+
place-items: safe end;
6621+
}
6622+
66036623
.place-items-start {
66046624
place-items: start;
66056625
}
@@ -6630,8 +6650,10 @@ test('align-content', async () => {
66306650
await run([
66316651
'content-normal',
66326652
'content-center',
6653+
'content-center-safe',
66336654
'content-start',
66346655
'content-end',
6656+
'content-end-safe',
66356657
'content-between',
66366658
'content-around',
66376659
'content-evenly',
@@ -6655,10 +6677,18 @@ test('align-content', async () => {
66556677
align-content: center;
66566678
}
66576679
6680+
.content-center-safe {
6681+
align-content: safe center;
6682+
}
6683+
66586684
.content-end {
66596685
align-content: flex-end;
66606686
}
66616687
6688+
.content-end-safe {
6689+
align-content: safe flex-end;
6690+
}
6691+
66626692
.content-evenly {
66636693
align-content: space-evenly;
66646694
}
@@ -6701,8 +6731,17 @@ test('align-content', async () => {
67016731
})
67026732

67036733
test('items', async () => {
6704-
expect(await run(['items-start', 'items-end', 'items-center', 'items-baseline', 'items-stretch']))
6705-
.toMatchInlineSnapshot(`
6734+
expect(
6735+
await run([
6736+
'items-start',
6737+
'items-end',
6738+
'items-end-safe',
6739+
'items-center',
6740+
'items-center-safe',
6741+
'items-baseline',
6742+
'items-stretch',
6743+
]),
6744+
).toMatchInlineSnapshot(`
67066745
".items-baseline {
67076746
align-items: baseline;
67086747
}
@@ -6711,10 +6750,18 @@ test('items', async () => {
67116750
align-items: center;
67126751
}
67136752
6753+
.items-center-safe {
6754+
align-items: safe center;
6755+
}
6756+
67146757
.items-end {
67156758
align-items: flex-end;
67166759
}
67176760
6761+
.items-end-safe {
6762+
align-items: safe flex-end;
6763+
}
6764+
67186765
.items-start {
67196766
align-items: flex-start;
67206767
}
@@ -6746,7 +6793,9 @@ test('justify', async () => {
67466793
'justify-normal',
67476794
'justify-start',
67486795
'justify-end',
6796+
'justify-end-safe',
67496797
'justify-center',
6798+
'justify-center-safe',
67506799
'justify-between',
67516800
'justify-around',
67526801
'justify-evenly',
@@ -6765,10 +6814,18 @@ test('justify', async () => {
67656814
justify-content: center;
67666815
}
67676816
6817+
.justify-center-safe {
6818+
justify-content: safe center;
6819+
}
6820+
67686821
.justify-end {
67696822
justify-content: flex-end;
67706823
}
67716824
6825+
.justify-end-safe {
6826+
justify-content: safe flex-end;
6827+
}
6828+
67726829
.justify-evenly {
67736830
justify-content: space-evenly;
67746831
}
@@ -6813,18 +6870,28 @@ test('justify-items', async () => {
68136870
await run([
68146871
'justify-items-start',
68156872
'justify-items-end',
6873+
'justify-items-end-safe',
68166874
'justify-items-center',
6875+
'justify-items-center-safe',
68176876
'justify-items-stretch',
68186877
]),
68196878
).toMatchInlineSnapshot(`
68206879
".justify-items-center {
68216880
justify-items: center;
68226881
}
68236882
6883+
.justify-items-center-safe {
6884+
justify-items: safe center;
6885+
}
6886+
68246887
.justify-items-end {
68256888
justify-items: end;
68266889
}
68276890
6891+
.justify-items-end-safe {
6892+
justify-items: safe end;
6893+
}
6894+
68286895
.justify-items-start {
68296896
justify-items: start;
68306897
}
@@ -7728,7 +7795,9 @@ test('place-self', async () => {
77287795
'place-self-auto',
77297796
'place-self-start',
77307797
'place-self-end',
7798+
'place-self-end-safe',
77317799
'place-self-center',
7800+
'place-self-center-safe',
77327801
'place-self-stretch',
77337802
]),
77347803
).toMatchInlineSnapshot(`
@@ -7740,10 +7809,18 @@ test('place-self', async () => {
77407809
place-self: center;
77417810
}
77427811
7812+
.place-self-center-safe {
7813+
place-self: safe center;
7814+
}
7815+
77437816
.place-self-end {
77447817
place-self: end;
77457818
}
77467819
7820+
.place-self-end-safe {
7821+
place-self: safe end;
7822+
}
7823+
77477824
.place-self-start {
77487825
place-self: start;
77497826
}
@@ -7775,7 +7852,9 @@ test('self', async () => {
77757852
'self-auto',
77767853
'self-start',
77777854
'self-end',
7855+
'self-end-safe',
77787856
'self-center',
7857+
'self-center-safe',
77797858
'self-stretch',
77807859
'self-baseline',
77817860
]),
@@ -7792,10 +7871,18 @@ test('self', async () => {
77927871
align-self: center;
77937872
}
77947873
7874+
.self-center-safe {
7875+
align-self: safe center;
7876+
}
7877+
77957878
.self-end {
77967879
align-self: flex-end;
77977880
}
77987881
7882+
.self-end-safe {
7883+
align-self: safe flex-end;
7884+
}
7885+
77997886
.self-start {
78007887
align-self: flex-start;
78017888
}
@@ -7829,7 +7916,9 @@ test('justify-self', async () => {
78297916
'justify-self-auto',
78307917
'justify-self-start',
78317918
'justify-self-end',
7919+
'justify-self-end-safe',
78327920
'justify-self-center',
7921+
'justify-self-center-safe',
78337922
'justify-self-stretch',
78347923
'justify-self-baseline',
78357924
]),
@@ -7842,10 +7931,18 @@ test('justify-self', async () => {
78427931
justify-self: center;
78437932
}
78447933
7934+
.justify-self-center-safe {
7935+
justify-self: safe center;
7936+
}
7937+
78457938
.justify-self-end {
78467939
justify-self: flex-end;
78477940
}
78487941
7942+
.justify-self-end-safe {
7943+
justify-self: safe flex-end;
7944+
}
7945+
78497946
.justify-self-start {
78507947
justify-self: flex-start;
78517948
}

0 commit comments

Comments
 (0)