redoc/src/common-elements/panels.ts

76 lines
1.8 KiB
TypeScript
Raw Normal View History

2018-08-16 09:56:47 +03:00
import { SECTION_ATTR } from '../services/MenuStore';
import styled, { media } from '../styled-components';
2017-10-12 00:01:37 +03:00
export const MiddlePanel = styled.div<{ compact?: boolean }>`
2018-03-16 18:02:31 +03:00
width: calc(100% - ${props => props.theme.rightPanel.width});
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
2018-01-30 16:35:18 +03:00
${({ compact, theme }) =>
media.lessThan('medium', true)`
2018-01-30 16:35:18 +03:00
width: 100%;
padding: ${`${compact ? 0 : theme.spacing.sectionVertical}px ${
theme.spacing.sectionHorizontal
}px`};
2018-01-30 16:35:18 +03:00
`};
2017-10-12 00:01:37 +03:00
`;
export const Section = styled.div.attrs(props => ({
[SECTION_ATTR]: props.id,
}))<{ underlined?: boolean }>`
padding: ${props => props.theme.spacing.sectionVertical}px 0;
2018-08-16 09:56:47 +03:00
&:last-child {
min-height: calc(100vh + 1px);
}
& > &:last-child {
min-height: initial;
}
2018-10-05 15:57:12 +03:00
${media.lessThan('medium', true)`
padding: 0;
`}
${(props: any) =>
2018-08-16 09:56:47 +03:00
(props.underlined &&
`
position: relative;
&:not(:last-of-type):after {
position: absolute;
bottom: 0;
width: 100%;
display: block;
content: '';
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
`) ||
''}
`;
2017-10-12 00:01:37 +03:00
export const RightPanel = styled.div`
2018-03-16 18:02:31 +03:00
width: ${props => props.theme.rightPanel.width};
color: ${({ theme }) => theme.rightPanel.textColor};
2018-03-16 18:02:31 +03:00
background-color: ${props => props.theme.rightPanel.backgroundColor};
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
2018-01-30 16:35:18 +03:00
2018-10-05 15:57:12 +03:00
${media.lessThan('medium', true)`
2018-01-30 16:35:18 +03:00
width: 100%;
padding: ${props =>
`${props.theme.spacing.sectionVertical}px ${props.theme.spacing.sectionHorizontal}px`};
2018-01-30 16:35:18 +03:00
`};
2017-10-12 00:01:37 +03:00
`;
export const DarkRightPanel = styled(RightPanel)`
background-color: ${props => props.theme.rightPanel.backgroundColor};
`;
export const Row = styled.div`
display: flex;
width: 100%;
2018-08-16 09:56:47 +03:00
padding: 0;
2018-01-30 16:35:18 +03:00
2018-10-05 15:57:12 +03:00
${media.lessThan('medium', true)`
2018-01-30 16:35:18 +03:00
flex-direction: column;
`};
`;