From fcaa01e5b047ade9386e209007923cbc48413651 Mon Sep 17 00:00:00 2001 From: Thomas Diroll Date: Fri, 29 Mar 2024 12:56:32 +0100 Subject: [PATCH] fix: add support for value system With this fix the value `'system'` for the local storage variable `STRAPI_THEME` is supported. --- admin/src/components/CKEditorInput/GlobalStyling.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/src/components/CKEditorInput/GlobalStyling.js b/admin/src/components/CKEditorInput/GlobalStyling.js index 403453a..56a72b6 100644 --- a/admin/src/components/CKEditorInput/GlobalStyling.js +++ b/admin/src/components/CKEditorInput/GlobalStyling.js @@ -6,6 +6,9 @@ import { style as dark } from "./styles/dark"; export const getGlobalStyling = ( theme ) => { let themeStyle = null; switch ( theme ) { + case 'system': + themeStyle = window.matchMedia("(prefers-color-scheme: dark)").matches ? dark : light; + break; case 'dark': themeStyle = dark; break;