mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 07:33:42 -06:00
TopNav: Cleanup theme flags (#67990)
* TopNav: Cleanup theme flags * Update * update
This commit is contained in:
parent
bdc1d666f4
commit
7b9e047ffd
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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};
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user