feat: allow passing pageTheme in createThemeOptions
This commit is contained in:
@@ -24,8 +24,6 @@ import {
|
||||
SimpleThemeOptions,
|
||||
} from './types';
|
||||
|
||||
import { pageTheme } from './pageTheme';
|
||||
|
||||
const DEFAULT_FONT_FAMILY =
|
||||
'"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';
|
||||
|
||||
@@ -36,6 +34,7 @@ export function createThemeOptions(
|
||||
palette,
|
||||
fontFamily = DEFAULT_FONT_FAMILY,
|
||||
defaultPageTheme,
|
||||
pageTheme,
|
||||
} = options;
|
||||
|
||||
if (!pageTheme[defaultPageTheme]) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { createTheme } from './baseTheme';
|
||||
import { pageTheme } from './pageTheme';
|
||||
import { yellow } from '@material-ui/core/colors';
|
||||
|
||||
export const lightTheme = createTheme({
|
||||
@@ -74,6 +75,7 @@ export const lightTheme = createTheme({
|
||||
},
|
||||
},
|
||||
defaultPageTheme: 'home',
|
||||
pageTheme,
|
||||
});
|
||||
|
||||
export const darkTheme = createTheme({
|
||||
@@ -133,4 +135,5 @@ export const darkTheme = createTheme({
|
||||
},
|
||||
},
|
||||
defaultPageTheme: 'home',
|
||||
pageTheme,
|
||||
});
|
||||
|
||||
@@ -94,6 +94,7 @@ export interface BackstageThemeOptions extends ThemeOptions {
|
||||
export type SimpleThemeOptions = {
|
||||
palette: BackstagePaletteOptions;
|
||||
defaultPageTheme: string;
|
||||
pageTheme: Record<string, PageTheme>;
|
||||
fontFamily?: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user