Skip to content

Commit

Permalink
feat: new theme options spacing-> sectionHorizontal and sectionVertical
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Oct 5, 2018
1 parent 56ad844 commit 505463f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/common-elements/panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled, { media, withProps } from '../styled-components';

export const MiddlePanel = styled.div`
width: calc(100% - ${props => props.theme.rightPanel.width});
padding: 0 ${props => props.theme.spacing.unit * 8}px;
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
${media.lessThan('medium')`
width: 100%;
Expand All @@ -15,7 +15,7 @@ export const Section = withProps<{ underlined?: boolean }>(
[SECTION_ATTR]: props => props.id,
} as any),
)`
padding: ${props => props.theme.spacing.unit * 8}px 0;
padding: ${props => props.theme.spacing.sectionVertical}px 0;
${props =>
(props.underlined &&
Expand All @@ -38,7 +38,7 @@ export const RightPanel = styled.div`
width: ${props => props.theme.rightPanel.width};
color: #fafbfc;
background-color: ${props => props.theme.rightPanel.backgroundColor};
padding: 0 ${props => props.theme.spacing.unit * 8}px;
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
${media.lessThan('medium')`
width: 100%;
Expand Down
4 changes: 0 additions & 4 deletions src/components/Redoc/styled.elements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export const RedocWrap = styled.div`
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}
.redoc-markdown h1 {
padding-top: ${theme.spacing.unit * 16}px;
}
`};
`;

Expand Down
4 changes: 4 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { darken, desaturate, lighten, readableColor, transparentize } from 'poli
const defaultTheme: ThemeInterface = {
spacing: {
unit: 5,
sectionHorizontal: ({ spacing }) => spacing.unit * 8,
sectionVertical: ({ spacing }) => spacing.unit * 8,
},
breakpoints: {
small: '50rem',
Expand Down Expand Up @@ -202,6 +204,8 @@ export interface FontSettings {
export interface ResolvedThemeInterface {
spacing: {
unit: number;
sectionHorizontal: number;
sectionVertical: number;
};
breakpoints: {
small: string;
Expand Down

0 comments on commit 505463f

Please sign in to comment.