From cbce28aec35c3357ca0789e9c79764047eabe95c Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 20 Mar 2018 16:15:36 +0200 Subject: [PATCH] feat: add more options to theme --- src/common-elements/fields.ts | 9 +++++---- src/theme.ts | 8 +++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/common-elements/fields.ts b/src/common-elements/fields.ts index 6d04d355db..33941f677d 100644 --- a/src/common-elements/fields.ts +++ b/src/common-elements/fields.ts @@ -13,20 +13,21 @@ export const FieldLabel = styled.span` `; export const TypePrefix = FieldLabel.extend` - color: ${props => transparentize(0.4, props.theme.colors.text)}; + color: ${props => transparentize(0.2, props.theme.schemaView.typeNameColor)}; `; export const TypeName = FieldLabel.extend` - color: ${props => transparentize(0.8, props.theme.colors.text)}; + color: ${props => props.theme.schemaView.typeNameColor}; `; + export const TypeTitle = FieldLabel.extend` - color: ${props => transparentize(0.5, props.theme.colors.text)}; + color: ${props => props.theme.schemaView.typeTitleColor}; `; export const TypeFormat = TypeName; export const RequiredLabel = FieldLabel.withComponent('div').extend` - color: #e53935; + color: ${props => props.theme.schemaView.requireLabelColor}; font-size: 11px; font-weight: normal; margin-left: 20px; diff --git a/src/theme.ts b/src/theme.ts index f18ebddd5e..0729291a51 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -1,4 +1,4 @@ -import { adjustHue, desaturate, lighten } from 'polished'; +import { adjustHue, desaturate, lighten, transparentize } from 'polished'; const defaultTheme: ThemeInterface = { spacingUnit: 20, @@ -29,6 +29,9 @@ const defaultTheme: ThemeInterface = { schemaView: { linesColor: theme => lighten(0.25, desaturate(0.35, theme.colors.main)), defaultDetailsWidth: '75%', + typeNameColor: theme => transparentize(0.8, theme.colors.text), + typeTitleColor: theme => theme.schemaView.typeNameColor, + requireLabelColor: theme => theme.colors.error, }, baseFont: { size: '14px', @@ -129,6 +132,9 @@ export interface ResolvedThemeInterface { schemaView: { linesColor: string; defaultDetailsWidth: string; + typeNameColor: string; + typeTitleColor: string; + requireLabelColor: string; }; baseFont: { size: string;