Load ant theme in classic Flipper as well

Summary: If a new code path uses some Ant design based components in classic flipper, they are unstyled before this diff. By making sure that the ant stylesheet is loaded we can safely 'leak' new UI elements into the old UI. For example when we use toasters, dialogs etc.

Reviewed By: cekkaewnumchai

Differential Revision: D24021751

fbshipit-source-id: 3b42d28f1c75e4df441170660027562264e879dd
This commit is contained in:
Michel Weststrate
2020-10-01 05:32:07 -07:00
committed by Facebook GitHub Bot
parent 650158ca35
commit 4e6ecac43e
4 changed files with 5 additions and 19 deletions

View File

@@ -106,11 +106,9 @@ function init() {
store,
{name: 'loadTheme', fireImmediately: true, throttleMs: 500},
(state) =>
state.settingsState.enableSandy
? state.settingsState.darkMode
? 'themes/dark'
: 'themes/light'
: 'none',
state.settingsState.enableSandy && state.settingsState.darkMode
? 'themes/dark'
: 'themes/light',
(theme) => {
(document.getElementById(
'flipper-theme-import',

View File

@@ -1,12 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
/*
used as theme in case Sandy is not enabled
*/

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<link id="flipper-theme-import" rel="stylesheet" href="empty.css">
<link id="flipper-theme-import" rel="stylesheet" href="themes/light.css">
<link rel="stylesheet" href="graphiql/graphiql.css">
<link rel="stylesheet" href="vis/vis.min.css">
<title>Flipper</title>

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<link id="flipper-theme-import" rel="stylesheet" href="empty.css">
<link id="flipper-theme-import" rel="stylesheet" href="themes/light.css">
<link rel="stylesheet" href="graphiql/graphiql.css">
<link rel="stylesheet" href="vis/vis.min.css">
<title>Flipper</title>