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:
committed by
Facebook GitHub Bot
parent
48c0cdeb07
commit
02570136ce
@@ -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);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -72,3 +72,8 @@
|
||||
@link-color: @primary-color;
|
||||
@link-hover: @primary-color;
|
||||
@link-hover-decoration: underline;
|
||||
|
||||
.flipperlegacy_design {
|
||||
// Prevents ANT breaking global styles implicitly used by old Flipper design
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user