Skip to content

Commit a22398c

Browse files
committed
Add empty variant support to JIT
1 parent 212bec9 commit a22398c

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- JIT: Support applying important utility variants ([#4260](https://github.com/tailwindlabs/tailwindcss/pull/4260))
1717
- JIT: Support coercing arbitrary values when the type isn't detectable ([#4263](https://github.com/tailwindlabs/tailwindcss/pull/4263))
1818
- JIT: Support for `raw` syntax in `purge` config ([#4272](https://github.com/tailwindlabs/tailwindcss/pull/4272))
19+
- Add `empty` variant ([#3298](https://github.com/tailwindlabs/tailwindcss/pull/3298))
1920

2021
### Fixed
2122

src/jit/corePlugins.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default {
1919
['even', 'nth-child(even)'],
2020
'visited',
2121
'checked',
22+
'empty',
2223
'focus-within',
2324
'hover',
2425
'focus',

tests/jit/variants.test.css

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
4343
var(--tw-shadow);
4444
}
45+
.empty\:shadow-md:empty {
46+
--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
47+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
48+
var(--tw-shadow);
49+
}
4550
.focus-within\:shadow-md:focus-within {
4651
--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
4752
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),

tests/jit/variants.test.html

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<div class="checked:shadow-md"></div>
2323
<div class="focus-within:shadow-md"></div>
2424
<div class="focus-visible:shadow-md"></div>
25+
<div class="empty:shadow-md"></div>
2526

2627
<!-- Group variants -->
2728
<div class="group-hover:shadow-md"></div>

0 commit comments

Comments
 (0)