Fix ANT line-height leaking into legacy design

Summary:
Fixes layout issue that was caused by ANT line-heights leaking into the old design.

Introduced a `.flipperlegacy_design ` class at the `root` element of Flipper, so that it is easier in the future to bail out / add overrides for certain features in the old design.

Reviewed By: priteshrnandgaonkar

Differential Revision: D24135482

fbshipit-source-id: 40091ebbde71662f2ebea66577f7b727009ca9c6
This commit is contained in:
Michel Weststrate
2020-10-06 04:56:24 -07:00
committed by Facebook GitHub Bot
parent 48c0cdeb07
commit 02570136ce
2 changed files with 15 additions and 5 deletions

View File

@@ -105,14 +105,19 @@ function init() {
sideEffect(
store,
{name: 'loadTheme', fireImmediately: true, throttleMs: 500},
(state) =>
state.settingsState.enableSandy && state.settingsState.darkMode
? 'themes/dark'
: 'themes/light',
(state) => ({
sandy: state.settingsState.enableSandy,
dark: state.settingsState.darkMode,
}),
(theme) => {
(document.getElementById(
'flipper-theme-import',
) as HTMLLinkElement).href = `${theme}.css`;
) as HTMLLinkElement).href = `themes/${
theme.sandy && theme.dark ? 'dark' : 'light'
}.css`;
document
.getElementById('root')
?.classList.toggle('flipperlegacy_design', !theme.sandy);
},
);
}