Skip to content

Commit

Permalink
feat: add more options to theme
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Mar 20, 2018
1 parent 0703c7f commit cbce28a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/common-elements/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { adjustHue, desaturate, lighten } from 'polished';
import { adjustHue, desaturate, lighten, transparentize } from 'polished';

const defaultTheme: ThemeInterface = {
spacingUnit: 20,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -129,6 +132,9 @@ export interface ResolvedThemeInterface {
schemaView: {
linesColor: string;
defaultDetailsWidth: string;
typeNameColor: string;
typeTitleColor: string;
requireLabelColor: string;
};
baseFont: {
size: string;
Expand Down

0 comments on commit cbce28a

Please sign in to comment.