feat: Extend Scheme

This commit is contained in:
Till Kolter 2020-08-23 13:10:03 +02:00
parent 02381504f5
commit 029b82b209

View File

@ -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;