Skip to content

Commit

Permalink
Merge pull request #3490 from microsoftgraph/fix/theme
Browse files Browse the repository at this point in the history
fix: remove system default for now
  • Loading branch information
Mnickii authored Dec 16, 2024
2 parents f11865e + c427d6e commit e4957e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/app/views/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,7 @@ class App extends Component<IAppProps, IAppState> {
const fluentV9Themes: Record<string, Theme> = {
'light': webLightTheme,
'dark': webDarkTheme,
'high-contrast': teamsHighContrastTheme,
'system': getSystemTheme() === 'dark' ? webDarkTheme : webLightTheme
'high-contrast': teamsHighContrastTheme
}
return (
// @ts-ignore
Expand Down
5 changes: 0 additions & 5 deletions src/app/views/main-header/settings/ThemeChooserV9.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ const availableThemes = [
key: 'high-contrast',
displayName: 'Teams High Contrast',
icon: <CircleHalfFillFilled />
},
{
key: 'system',
displayName: 'System Default',
icon: <SettingsFilled />
}
];

Expand Down
10 changes: 1 addition & 9 deletions src/themes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@ import { IPartialTheme, loadTheme } from '@fluentui/react';
import { dark } from './dark';
import { highContrast } from './high-contrast';
import { light } from './light';
// changes to be removed on cleanup
const getSystemTheme = (): string => {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
}
return 'light';
};

const themes: any = {
dark,
light,
'high-contrast': highContrast,
system: getSystemTheme() === 'dark' ? dark : light
'high-contrast': highContrast
};

export function loadGETheme(theme: string): void {
Expand Down

0 comments on commit e4957e6

Please sign in to comment.