Skip to content

Commit cbce28a

Browse files
committed
feat: add more options to theme
1 parent 0703c7f commit cbce28a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/common-elements/fields.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,21 @@ export const FieldLabel = styled.span`
1313
`;
1414

1515
export const TypePrefix = FieldLabel.extend`
16-
color: ${props => transparentize(0.4, props.theme.colors.text)};
16+
color: ${props => transparentize(0.2, props.theme.schemaView.typeNameColor)};
1717
`;
1818

1919
export const TypeName = FieldLabel.extend`
20-
color: ${props => transparentize(0.8, props.theme.colors.text)};
20+
color: ${props => props.theme.schemaView.typeNameColor};
2121
`;
22+
2223
export const TypeTitle = FieldLabel.extend`
23-
color: ${props => transparentize(0.5, props.theme.colors.text)};
24+
color: ${props => props.theme.schemaView.typeTitleColor};
2425
`;
2526

2627
export const TypeFormat = TypeName;
2728

2829
export const RequiredLabel = FieldLabel.withComponent('div').extend`
29-
color: #e53935;
30+
color: ${props => props.theme.schemaView.requireLabelColor};
3031
font-size: 11px;
3132
font-weight: normal;
3233
margin-left: 20px;

src/theme.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { adjustHue, desaturate, lighten } from 'polished';
1+
import { adjustHue, desaturate, lighten, transparentize } from 'polished';
22

33
const defaultTheme: ThemeInterface = {
44
spacingUnit: 20,
@@ -29,6 +29,9 @@ const defaultTheme: ThemeInterface = {
2929
schemaView: {
3030
linesColor: theme => lighten(0.25, desaturate(0.35, theme.colors.main)),
3131
defaultDetailsWidth: '75%',
32+
typeNameColor: theme => transparentize(0.8, theme.colors.text),
33+
typeTitleColor: theme => theme.schemaView.typeNameColor,
34+
requireLabelColor: theme => theme.colors.error,
3235
},
3336
baseFont: {
3437
size: '14px',
@@ -129,6 +132,9 @@ export interface ResolvedThemeInterface {
129132
schemaView: {
130133
linesColor: string;
131134
defaultDetailsWidth: string;
135+
typeNameColor: string;
136+
typeTitleColor: string;
137+
requireLabelColor: string;
132138
};
133139
baseFont: {
134140
size: string;

0 commit comments

Comments
 (0)