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 Dec 13, 2023
1 parent b3242e9 commit fb85c8f
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 @@ -758,8 +758,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 @@ -300,6 +300,11 @@
:is(.dark .peer:disabled:focus:hover ~ .dark\:peer-disabled\:peer-focus\:peer-hover\:flex) {
display: flex;
}
@media (forced-colors: active) {
.forced-colors\:flex {
display: flex;
}
}
@media print {
.print\:flex {
display: flex;
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:flex"></div>

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

<!-- Print variant -->
<div class="print:flex"></div>

Expand Down

0 comments on commit fb85c8f

Please sign in to comment.