Use dark scrollbar and system elements

Summary:
This diff adds OS support for dark mode (at least on Mac), by making sure system elements are styled according to system dark theme.

For some unknown reason, this does apply to all system dialogs, titlebars etc, but not for scrollbars, so they got custom themed.

Differential Revision: D29436058

fbshipit-source-id: bac649b6cd81f0142c607ed567eeb00f41625041
This commit is contained in:
Michel Weststrate
2021-06-29 08:38:33 -07:00
committed by Facebook GitHub Bot
parent 5c8dde0925
commit 617f8a928c
3 changed files with 13 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ import {CopyOutlined} from '@ant-design/icons';
import {clipboard} from 'electron/common';
import {getVersionString} from './utils/versionString';
import {PersistGate} from 'redux-persist/integration/react';
import {ipcRenderer} from 'electron';
if (process.env.NODE_ENV === 'development' && os.platform() === 'darwin') {
// By default Node.JS has its internal certificate storage and doesn't use
@@ -222,6 +223,7 @@ function init() {
(
document.getElementById('flipper-theme-import') as HTMLLinkElement
).href = `themes/${theme.dark ? 'dark' : 'light'}.css`;
ipcRenderer.send('setTheme', theme.dark ? 'dark' : 'light');
},
);
}