From e0226251877e52f1a9450603e9be6849821d3b6a Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Wed, 17 Jan 2024 09:28:12 +0000 Subject: [PATCH] Set the color-scheme property based on Wagtail theming support. Fix #11309 --- client/tailwind.config.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/tailwind.config.js b/client/tailwind.config.js index 4a3c47f88c..9c47652d5d 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -168,13 +168,18 @@ module.exports = { ...transparencies, ...generateColorVariables(staticColors), ...generateThemeColorVariables(colorThemes.light), + 'color-scheme': 'light', }, '.w-theme-system': { - '@media (prefers-color-scheme: dark)': generateThemeColorVariables( - colorThemes.dark, - ), + '@media (prefers-color-scheme: dark)': { + ...generateThemeColorVariables(colorThemes.dark), + 'color-scheme': 'dark', + }, + }, + '.w-theme-dark': { + ...generateThemeColorVariables(colorThemes.dark), + 'color-scheme': 'dark', }, - '.w-theme-dark': generateThemeColorVariables(colorThemes.dark), }); }), /** Support for aria-expanded=true variant */