MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / parseSystemTheme

Function parseSystemTheme

web/pgadmin/static/js/Theme/index.jsx:900–912  ·  view source on GitHub ↗
(selectedTheme)

Source from the content-addressed store, hash-verified

898
899/* Get the actual system theme is user selected system theme in preferences */
900function parseSystemTheme(selectedTheme) {
901 if (selectedTheme === 'system') {
902 const systemMatchMedia = matchMedia('(prefers-color-scheme: dark)');
903 return {
904 'theme': systemMatchMedia.matches ? 'dark' : 'light',
905 'systemMatchMedia': systemMatchMedia,
906 };
907 }
908 return {
909 'theme': selectedTheme,
910 'systemMatchMedia': null,
911 };
912}
913
914/* Theme wrapper used by DOM containers to apply theme */
915/* In future, this will be moved to App container */

Callers 1

ThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected