Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backdrop variant #7924

Merged
merged 3 commits into from Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/corePlugins.js
Expand Up @@ -26,6 +26,8 @@ export let variantPlugins = {
addVariant('file', '&::file-selector-button')

addVariant('placeholder', '&::placeholder')

addVariant('backdrop', '&::backdrop')

addVariant('before', ({ container }) => {
container.walkRules((rule) => {
Expand Down
6 changes: 6 additions & 0 deletions tests/variants.test.css
Expand Up @@ -261,6 +261,12 @@
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
var(--tw-shadow);
}
.backdrop\:shadow-md::backdrop {
--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
var(--tw-shadow);
}
.focus-within\:shadow-md:focus-within {
--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
Expand Down
1 change: 1 addition & 0 deletions tests/variants.test.html
Expand Up @@ -39,6 +39,7 @@
<div class="out-of-range:shadow-md"></div>
<div class="read-only:shadow-md"></div>
<div class="empty:shadow-md"></div>
<dialog class="backdrop:shadow-md"></dialog>

<!-- Pseudo-element variants -->
<div class="first-letter:text-2xl first-letter:text-red-500"></div>
Expand Down