diff --git a/admin/src/components/Input.jsx b/admin/src/components/Input.jsx index 510cbd2..218446a 100644 --- a/admin/src/components/Input.jsx +++ b/admin/src/components/Input.jsx @@ -6,8 +6,9 @@ import { useIntl } from "react-intl"; import TagsInput from "react-tagsinput"; import Autosuggest from "react-autosuggest"; import { getStyling } from "./styles/global"; +import { getCurrentTheme } from '../utils/getCurrentTheme'; -const ThemeStyle = getStyling(localStorage.getItem("STRAPI_THEME")); +const ThemeStyle = getStyling(getCurrentTheme()); const Tags = ({ attribute, @@ -145,7 +146,7 @@ const Tags = ({ [attrName]: state[attrName] || "", })); } - + return ( { + const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? "dark" : "light"; + const strapiTheme = localStorage.getItem("STRAPI_THEME"); + + return (!strapiTheme || strapiTheme === 'system') ? systemTheme : strapiTheme; +}; \ No newline at end of file