feat: add gray color to theme

This commit is contained in:
Oleksiy Kachynskyy 2020-04-08 09:39:40 +03:00
parent 2b36becad9
commit 0511c678db
5 changed files with 17 additions and 11 deletions

View File

@ -53,7 +53,7 @@ export class CallbackSamples extends React.Component<CallbackSamplesProps> {
return ( return (
(hasSamples && ( (hasSamples && (
<div> <div>
<RightPanelHeader> Callback request samples </RightPanelHeader> <RightPanelHeader> Callback payload samples </RightPanelHeader>
<SamplesWrapper> <SamplesWrapper>
<GenericDropdown <GenericDropdown

View File

@ -31,11 +31,11 @@ export class CallbacksList extends React.PureComponent<CallbacksListProps> {
} }
} }
// TODO: get text color and font size from the theme? // TODO: get font size from the theme?
const CallbacksHeader = styled.h3` const CallbacksHeader = styled.h3`
font-size: 18px; font-size: 18px;
padding: 0.2em 0; padding: 0.2em 0;
margin: 3em 0 1.1em; margin: 3em 0 1.1em;
color: #253137; color: ${({ theme }) => theme.colors.text.primary};
font-weight: normal; font-weight: normal;
`; `;

View File

@ -1,22 +1,18 @@
import styled from '../../styled-components'; import styled from '../../styled-components';
import { CallbackTitle } from './CallbackTitle'; import { CallbackTitle } from './CallbackTitle';
// TODO: get 'background-color' from theme
// e.g. "theme.colors.secondary.main" or "theme.colors.callbacks.background.main"
export const StyledCallbackTitle = styled(CallbackTitle)` export const StyledCallbackTitle = styled(CallbackTitle)`
padding: 10px; padding: 10px;
border-radius: 2px; border-radius: 2px;
margin-bottom: 4px; margin-bottom: 4px;
line-height: 1.5em; line-height: 1.5em;
background-color: #f2f2f2; background-color: ${({ theme }) => theme.colors.gray.A50};
cursor: pointer; cursor: pointer;
`; `;
// TODO: get 'background-color' from theme
// e.g. "theme.colors.secondary.light" or "theme.colors.callbacks.background.light"
export const CallbackDetailsWrap = styled.div` export const CallbackDetailsWrap = styled.div`
padding: 10px 25px; padding: 10px 25px;
background-color: #fafafa; background-color: ${({ theme }) => theme.colors.gray[50]};
margin-bottom: 5px; margin-bottom: 5px;
margin-top: 5px; margin-top: 5px;
`; `;

View File

@ -3,12 +3,12 @@ import { ResponseModel } from '../../services/models';
import styled from '../../styled-components'; import styled from '../../styled-components';
import { ResponseView } from './Response'; import { ResponseView } from './Response';
// TODO: get text color and font size from the theme? // TODO: get font size from the theme?
const ResponsesHeader = styled.h3` const ResponsesHeader = styled.h3`
font-size: 18px; font-size: 18px;
padding: 0.2em 0; padding: 0.2em 0;
margin: 3em 0 1.1em; margin: 3em 0 1.1em;
color: #253137; color: ${({ theme }) => theme.colors.text.primary};
font-weight: normal; font-weight: normal;
`; `;

View File

@ -37,6 +37,11 @@ const defaultTheme: ThemeInterface = {
dark: ({ colors }) => darken(colors.tonalOffset, colors.error.main), dark: ({ colors }) => darken(colors.tonalOffset, colors.error.main),
contrastText: ({ colors }) => readableColor(colors.error.main), contrastText: ({ colors }) => readableColor(colors.error.main),
}, },
gray: {
50: '#fafafa',
A50: '#f2f2f2',
A200: '#aaaaaa',
},
text: { text: {
primary: '#333333', primary: '#333333',
secondary: ({ colors }) => lighten(colors.tonalOffset, colors.text.primary), secondary: ({ colors }) => lighten(colors.tonalOffset, colors.text.primary),
@ -229,6 +234,11 @@ export interface ResolvedThemeInterface {
success: ColorSetting; success: ColorSetting;
warning: ColorSetting; warning: ColorSetting;
error: ColorSetting; error: ColorSetting;
gray: {
50: string;
A50: string;
A200: string;
};
border: { border: {
light: string; light: string;
dark: string; dark: string;