From 4771ddd48e0d1f217080cde46fc91c3cddca2145 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Tue, 12 Dec 2023 22:35:11 +0000 Subject: [PATCH] Move forced-colors variant after dark variant Also add test for the order of the forced-colors variant --- src/lib/setupContextUtils.js | 2 +- tests/variants.test.css | 5 +++++ tests/variants.test.html | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/setupContextUtils.js b/src/lib/setupContextUtils.js index 10bd0dc9664d..6920eb4dbf78 100644 --- a/src/lib/setupContextUtils.js +++ b/src/lib/setupContextUtils.js @@ -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'], diff --git a/tests/variants.test.css b/tests/variants.test.css index cedb35bb6ead..043ce991ee4a 100644 --- a/tests/variants.test.css +++ b/tests/variants.test.css @@ -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; diff --git a/tests/variants.test.html b/tests/variants.test.html index a9b2c2f16a59..8ce2bfa3f21c 100644 --- a/tests/variants.test.html +++ b/tests/variants.test.html @@ -121,6 +121,9 @@
+ +
+