Skip to content

Commit

Permalink
Move forced-colors variant after dark variant (#12582)
Browse files Browse the repository at this point in the history
Also add test for the order of the forced-colors variant
  • Loading branch information
lukewarlow authored and thecrypticace committed Dec 18, 2023
1 parent 47dbb4a commit 11a6ba3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/setupContextUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@ function resolvePlugins(context, root) {
variantPlugins['directionVariants'],
variantPlugins['reducedMotionVariants'],
variantPlugins['prefersContrastVariants'],
variantPlugins['forcedColorsVariants'],
variantPlugins['darkVariants'],
variantPlugins['forcedColorsVariants'],
variantPlugins['printVariant'],
variantPlugins['screenVariants'],
variantPlugins['orientationVariants'],
Expand Down
5 changes: 5 additions & 0 deletions tests/variants.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),
var(--tw-shadow);
}
@media (forced-colors: active) {
.forced-colors\:flex {
display: flex;
}
}
@media print {
.print\:bg-yellow-300 {
--tw-bg-opacity: 1;
Expand Down
3 changes: 3 additions & 0 deletions tests/variants.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
<!-- Dark mode variants -->
<div class="dark:shadow-md"></div>

<!-- Forced colors variant -->
<div class="forced-colors:flex"></div>

<!-- Print variant -->
<div class="print:bg-yellow-300"></div>

Expand Down

0 comments on commit 11a6ba3

Please sign in to comment.