mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-18 10:50:32 +03:00
feat: new theme options spacing-> sectionHorizontal and sectionVertical
This commit is contained in:
parent
56ad8443b7
commit
505463f5ab
|
@ -3,7 +3,7 @@ import styled, { media, withProps } from '../styled-components';
|
||||||
|
|
||||||
export const MiddlePanel = styled.div`
|
export const MiddlePanel = styled.div`
|
||||||
width: calc(100% - ${props => props.theme.rightPanel.width});
|
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')`
|
${media.lessThan('medium')`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -15,7 +15,7 @@ export const Section = withProps<{ underlined?: boolean }>(
|
||||||
[SECTION_ATTR]: props => props.id,
|
[SECTION_ATTR]: props => props.id,
|
||||||
} as any),
|
} as any),
|
||||||
)`
|
)`
|
||||||
padding: ${props => props.theme.spacing.unit * 8}px 0;
|
padding: ${props => props.theme.spacing.sectionVertical}px 0;
|
||||||
|
|
||||||
${props =>
|
${props =>
|
||||||
(props.underlined &&
|
(props.underlined &&
|
||||||
|
@ -38,7 +38,7 @@ export const RightPanel = styled.div`
|
||||||
width: ${props => props.theme.rightPanel.width};
|
width: ${props => props.theme.rightPanel.width};
|
||||||
color: #fafbfc;
|
color: #fafbfc;
|
||||||
background-color: ${props => props.theme.rightPanel.backgroundColor};
|
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')`
|
${media.lessThan('medium')`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -22,10 +22,6 @@ export const RedocWrap = styled.div`
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.redoc-markdown h1 {
|
|
||||||
padding-top: ${theme.spacing.unit * 16}px;
|
|
||||||
}
|
|
||||||
`};
|
`};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { darken, desaturate, lighten, readableColor, transparentize } from 'poli
|
||||||
const defaultTheme: ThemeInterface = {
|
const defaultTheme: ThemeInterface = {
|
||||||
spacing: {
|
spacing: {
|
||||||
unit: 5,
|
unit: 5,
|
||||||
|
sectionHorizontal: ({ spacing }) => spacing.unit * 8,
|
||||||
|
sectionVertical: ({ spacing }) => spacing.unit * 8,
|
||||||
},
|
},
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
small: '50rem',
|
small: '50rem',
|
||||||
|
@ -202,6 +204,8 @@ export interface FontSettings {
|
||||||
export interface ResolvedThemeInterface {
|
export interface ResolvedThemeInterface {
|
||||||
spacing: {
|
spacing: {
|
||||||
unit: number;
|
unit: number;
|
||||||
|
sectionHorizontal: number;
|
||||||
|
sectionVertical: number;
|
||||||
};
|
};
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
small: string;
|
small: string;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user