mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Charts] Fix borealis theme overrides (#209595)
## Summary This removes an override that was applied to the charts theme prior to updating the `Theme` in `@elastic/charts`. This is no longer needed and is now using the wrong color. ## Release note Fixes issue with `Amsterdam` theme where charts render with the incorrect background color.
This commit is contained in:
parent
bdc3470658
commit
595406176f
1 changed files with 2 additions and 16 deletions
|
@ -11,8 +11,7 @@ import { useEffect, useRef, useState } from 'react';
|
|||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
|
||||
import { CoreSetup, CoreTheme } from '@kbn/core/public';
|
||||
import { DARK_THEME, LIGHT_THEME, PartialTheme, Theme } from '@elastic/charts';
|
||||
import { euiThemeVars } from '@kbn/ui-theme';
|
||||
import { LIGHT_THEME, PartialTheme, Theme, getChartsTheme } from '@elastic/charts';
|
||||
|
||||
export class ThemeService {
|
||||
/** Returns default charts theme */
|
||||
|
@ -104,20 +103,7 @@ export class ThemeService {
|
|||
public init(theme: CoreSetup['theme']) {
|
||||
this.theme$ = theme.theme$;
|
||||
this.theme$.subscribe((newTheme) => {
|
||||
this._chartsBaseTheme$.next(getChartTheme(newTheme));
|
||||
this._chartsBaseTheme$.next(getChartsTheme(newTheme));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: define these overrides in elastic/charts when Borealis becomes default
|
||||
function getChartTheme(theme: CoreTheme): Theme {
|
||||
const chartTheme = theme.darkMode ? DARK_THEME : LIGHT_THEME;
|
||||
|
||||
if (theme.name !== 'amsterdam') {
|
||||
const backgroundColor = euiThemeVars.euiColorEmptyShade;
|
||||
chartTheme.background.color = backgroundColor;
|
||||
chartTheme.background.fallbackColor = backgroundColor;
|
||||
}
|
||||
|
||||
return chartTheme;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue