Skip to content

Commit 7986bc1

Browse files
committed
Add {min,max}-h-lh and h-lh utilities
1 parent a8c37e6 commit 7986bc1

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4562,6 +4562,7 @@ exports[`getClassList 1`] = `
45624562
"h-dvw",
45634563
"h-fit",
45644564
"h-full",
4565+
"h-lh",
45654566
"h-lvh",
45664567
"h-lvw",
45674568
"h-max",
@@ -7482,6 +7483,7 @@ exports[`getClassList 1`] = `
74827483
"max-h-dvw",
74837484
"max-h-fit",
74847485
"max-h-full",
7486+
"max-h-lh",
74857487
"max-h-lvh",
74867488
"max-h-lvw",
74877489
"max-h-max",
@@ -7703,6 +7705,7 @@ exports[`getClassList 1`] = `
77037705
"min-h-dvw",
77047706
"min-h-fit",
77057707
"min-h-full",
7708+
"min-h-lh",
77067709
"min-h-lvh",
77077710
"min-h-lvw",
77087711
"min-h-max",

packages/tailwindcss/src/utilities.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,6 +2917,7 @@ test('height', async () => {
29172917
'h-lvh',
29182918
'h-dvh',
29192919
'h-min',
2920+
'h-lh',
29202921
'h-max',
29212922
'h-fit',
29222923
'h-4',
@@ -2957,6 +2958,10 @@ test('height', async () => {
29572958
height: 100%;
29582959
}
29592960

2961+
.h-lh {
2962+
height: 1lh;
2963+
}
2964+
29602965
.h-lvh {
29612966
height: 100lvh;
29622967
}
@@ -2993,6 +2998,7 @@ test('height', async () => {
29932998
'h-svh/foo',
29942999
'h-lvh/foo',
29953000
'h-dvh/foo',
3001+
'h-lh/foo',
29963002
'h-min/foo',
29973003
'h-max/foo',
29983004
'h-fit/foo',
@@ -3020,6 +3026,7 @@ test('min-height', async () => {
30203026
'min-h-lvh',
30213027
'min-h-dvh',
30223028
'min-h-min',
3029+
'min-h-lh',
30233030
'min-h-max',
30243031
'min-h-fit',
30253032
'min-h-4',
@@ -3055,6 +3062,10 @@ test('min-height', async () => {
30553062
min-height: 100%;
30563063
}
30573064

3065+
.min-h-lh {
3066+
min-height: 1lh;
3067+
}
3068+
30583069
.min-h-lvh {
30593070
min-height: 100lvh;
30603071
}
@@ -3086,6 +3097,7 @@ test('min-height', async () => {
30863097
'min-h-svh/foo',
30873098
'min-h-lvh/foo',
30883099
'min-h-dvh/foo',
3100+
'min-h-lh/foo',
30893101
'min-h-min/foo',
30903102
'min-h-max/foo',
30913103
'min-h-fit/foo',
@@ -3111,6 +3123,7 @@ test('max-height', async () => {
31113123
'max-h-svh',
31123124
'max-h-lvh',
31133125
'max-h-dvh',
3126+
'max-h-lh',
31143127
'max-h-min',
31153128
'max-h-max',
31163129
'max-h-fit',
@@ -3143,6 +3156,10 @@ test('max-height', async () => {
31433156
max-height: 100%;
31443157
}
31453158

3159+
.max-h-lh {
3160+
max-height: 1lh;
3161+
}
3162+
31463163
.max-h-lvh {
31473164
max-height: 100lvh;
31483165
}
@@ -3179,6 +3196,7 @@ test('max-height', async () => {
31793196
'max-h-svh/foo',
31803197
'max-h-lvh/foo',
31813198
'max-h-dvh/foo',
3199+
'max-h-lh/foo',
31823200
'max-h-min/foo',
31833201
'max-h-max/foo',
31843202
'max-h-fit/foo',

packages/tailwindcss/src/utilities.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,11 @@ export function createUtilities(theme: Theme) {
976976
staticUtility(`h-auto`, [['height', 'auto']])
977977
staticUtility(`min-w-auto`, [['min-width', 'auto']])
978978
staticUtility(`min-h-auto`, [['min-height', 'auto']])
979+
980+
staticUtility(`h-lh`, [['height', '1lh']])
981+
staticUtility(`min-h-lh`, [['min-height', '1lh']])
982+
staticUtility(`max-h-lh`, [['max-height', '1lh']])
983+
979984
staticUtility(`w-screen`, [['width', '100vw']])
980985
staticUtility(`min-w-screen`, [['min-width', '100vw']])
981986
staticUtility(`max-w-screen`, [['max-width', '100vw']])

0 commit comments

Comments
 (0)