chore: make pageTheme optional & provide default value
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
BackstageThemeOptions,
|
||||
SimpleThemeOptions,
|
||||
} from './types';
|
||||
import { pageTheme as defaultPageThemes } from './pageTheme';
|
||||
|
||||
const DEFAULT_FONT_FAMILY =
|
||||
'"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif';
|
||||
@@ -34,7 +35,7 @@ export function createThemeOptions(
|
||||
palette,
|
||||
fontFamily = DEFAULT_FONT_FAMILY,
|
||||
defaultPageTheme,
|
||||
pageTheme,
|
||||
pageTheme = defaultPageThemes,
|
||||
} = options;
|
||||
|
||||
if (!pageTheme[defaultPageTheme]) {
|
||||
|
||||
@@ -94,7 +94,7 @@ export interface BackstageThemeOptions extends ThemeOptions {
|
||||
export type SimpleThemeOptions = {
|
||||
palette: BackstagePaletteOptions;
|
||||
defaultPageTheme: string;
|
||||
pageTheme: Record<string, PageTheme>;
|
||||
pageTheme?: Record<string, PageTheme>;
|
||||
fontFamily?: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user