TopNav: Cleanup theme flags (#67990)

* TopNav: Cleanup theme flags

* Update

* update
This commit is contained in:
Torkel Ödegaard 2023-06-20 13:58:57 +02:00 committed by GitHub
parent bdc1d666f4
commit 7b9e047ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 19 deletions

View File

@ -32,7 +32,7 @@ export interface GrafanaTheme2 {
/** @deprecated Will be removed in a future version */
v1: GrafanaTheme;
/** feature flags that might impact component looks */
flags: { topnav?: boolean };
flags: {};
}
/** @alpha */

View File

@ -204,9 +204,6 @@ export class GrafanaBootConfig implements GrafanaConfig {
this.theme2 = getThemeById(this.bootData.user.theme);
this.bootData.user.lightTheme = this.theme2.isLight;
this.theme = this.theme2.v1;
// Special feature toggle that impact theme/component looks
this.theme2.flags.topnav = this.featureToggles.topnav;
}
}

View File

@ -139,17 +139,6 @@ const getStyles = (theme: GrafanaTheme2) => {
}
`;
const defaultTopNav = css`
color: ${theme.colors.text.secondary};
background: transparent;
border: 1px solid transparent;
&:hover {
color: ${theme.colors.text.primary};
background: ${theme.colors.background.secondary};
}
`;
return {
button: css`
label: toolbar-button;
@ -195,7 +184,16 @@ const getStyles = (theme: GrafanaTheme2) => {
}
}
`,
default: defaultTopNav,
default: css`
color: ${theme.colors.text.secondary};
background: transparent;
border: 1px solid transparent;
&:hover {
color: ${theme.colors.text.primary};
background: ${theme.colors.background.secondary};
}
`,
canvas: defaultOld,
active: css`
color: ${theme.v1.palette.orangeDark};

View File

@ -12,9 +12,6 @@ export async function changeTheme(themeId: string, runtimeOnly?: boolean) {
const newTheme = getThemeById(themeId);
// Special feature toggle that impact theme/component looks
newTheme.flags.topnav = config.featureToggles.topnav;
appEvents.publish(new ThemeChangedEvent(newTheme));
// Add css file for new theme