From a5693f0cf596f94baf0c639565c0e2e3102d4599 Mon Sep 17 00:00:00 2001 From: Kieran Fahy Date: Fri, 7 Aug 2026 21:38:00 -0700 Subject: [PATCH] Fix dark mode option styling inside select optgroups The default select variant forces dark mode option colours with a child combinator, so options nested in an match neither rule and fall back to the browser's light mode rendering. Match them as descendants instead, which is strictly wider and leaves ungrouped selects unchanged. --- stubs/resources/views/flux/select/variants/default.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stubs/resources/views/flux/select/variants/default.blade.php b/stubs/resources/views/flux/select/variants/default.blade.php index c7c20ab9..4fcba8e9 100644 --- a/stubs/resources/views/flux/select/variants/default.blade.php +++ b/stubs/resources/views/flux/select/variants/default.blade.php @@ -24,7 +24,8 @@ // Make the placeholder match the text color of standard input placeholders... ->add('has-[option.placeholder:checked]:text-zinc-400 dark:has-[option.placeholder:checked]:text-zinc-400') // Options on Windows don't inherit dark mode styles, so we need to force them... - ->add('dark:[&>option]:bg-zinc-700 dark:[&>option]:text-white') + // Matched as descendants rather than children so options inside an are covered too... + ->add('dark:[&_option]:bg-zinc-700 dark:[&_option]:text-white') ->add('disabled:shadow-none') ->add($invalid ? 'border border-red-500'