From 029b82b209073da4942d07bacf2643b151b9c157 Mon Sep 17 00:00:00 2001 From: Till Kolter Date: Sun, 23 Aug 2020 13:10:03 +0200 Subject: [PATCH] feat: Extend Scheme --- src/theme.ts | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/theme.ts b/src/theme.ts index fef81f30..243d2178 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -80,21 +80,21 @@ const defaultTheme: ThemeInterface = { }, }, schema: { - linesColor: theme => + linesColor: (theme) => lighten( theme.colors.tonalOffset, desaturate(theme.colors.tonalOffset, theme.colors.primary.main), ), defaultDetailsWidth: '75%', - typeNameColor: theme => theme.colors.text.secondary, - typeTitleColor: theme => theme.schema.typeNameColor, - requireLabelColor: theme => theme.colors.error.main, + typeNameColor: (theme) => theme.colors.text.secondary, + typeTitleColor: (theme) => theme.schema.typeNameColor, + requireLabelColor: (theme) => theme.colors.error.main, labelsTextSize: '0.9em', nestingSpacing: '1em', nestedBackground: '#fafafa', arrow: { size: '1.1em', - color: theme => theme.colors.text.secondary, + color: (theme) => theme.colors.text.secondary, }, }, typography: { @@ -130,7 +130,7 @@ const defaultTheme: ThemeInterface = { width: '260px', backgroundColor: '#fafafa', textColor: '#333333', - activeTextColor: theme => + activeTextColor: (theme) => theme.sidebar.textColor !== defaultTheme.sidebar!.textColor ? theme.sidebar.textColor : theme.colors.primary.main, @@ -138,11 +138,19 @@ const defaultTheme: ThemeInterface = { textTransform: 'uppercase', }, level1Items: { + color: '#3C3C3C', textTransform: 'none', + fw: 600, + fontSize: '1rem' + }, + level2Items: { + fw: 500, + color: '#3C3C3C', + fontSize: '.95rem' }, arrow: { size: '1.5em', - color: theme => theme.sidebar.textColor, + color: (theme) => theme.sidebar.textColor, }, }, logo: { @@ -166,7 +174,7 @@ export function resolveTheme(theme: ThemeInterface): ResolvedThemeInterface { const resolvedValues = {}; let counter = 0; const setProxy = (obj, path: string) => { - Object.keys(obj).forEach(k => { + Object.keys(obj).forEach((k) => { const currentPath = (path ? path + '.' : '') + k; const val = obj[k]; if (typeof val === 'function') { @@ -313,7 +321,16 @@ export interface ResolvedThemeInterface { textTransform: string; }; level1Items: { + color: string; + fw: number; textTransform: string; + fontSize: string; + }; + level2Items: { + color: string; + fw: number; + textTransform: string; + fontSize: string; }; arrow: { size: string;