Skip to content

Commit fbcec82

Browse files
committed
fix: minor media print improvements
1 parent 393681b commit fbcec82

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

src/common-elements/panels.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const MiddlePanel = styled.div`
55
width: calc(100% - ${props => props.theme.rightPanel.width});
66
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
77
8-
${media.lessThan('medium')`
8+
${media.lessThan('medium', true)`
99
width: 100%;
1010
padding: ${props =>
1111
`${props.theme.spacing.sectionVertical}px ${props.theme.spacing.sectionHorizontal}px`};
@@ -19,7 +19,7 @@ export const Section = withProps<{ underlined?: boolean }>(
1919
)`
2020
padding: ${props => props.theme.spacing.sectionVertical}px 0;
2121
22-
${media.lessThan('medium')`
22+
${media.lessThan('medium', true)`
2323
padding: 0;
2424
`}
2525
${props =>
@@ -45,7 +45,7 @@ export const RightPanel = styled.div`
4545
background-color: ${props => props.theme.rightPanel.backgroundColor};
4646
padding: 0 ${props => props.theme.spacing.sectionHorizontal}px;
4747
48-
${media.lessThan('medium')`
48+
${media.lessThan('medium', true)`
4949
width: 100%;
5050
padding: ${props =>
5151
`${props.theme.spacing.sectionVertical}px ${props.theme.spacing.sectionHorizontal}px`};
@@ -61,7 +61,7 @@ export const Row = styled.div`
6161
width: 100%;
6262
padding: 0;
6363
64-
${media.lessThan('medium')`
64+
${media.lessThan('medium', true)`
6565
flex-direction: column;
6666
`};
6767
`;

src/components/Redoc/styled.elements.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ export const ApiContentWrap = styled.div`
3030
position: relative;
3131
overflow: hidden;
3232
width: calc(100% - ${props => props.theme.menu.width});
33-
${media.lessThan('small')`
33+
${media.lessThan('small', true)`
3434
width: 100%;
3535
`};
36+
3637
contain: layout;
3738
`;
3839

@@ -43,7 +44,7 @@ export const BackgroundStub = styled.div`
4344
bottom: 0;
4445
right: 0;
4546
width: calc((100% - ${({ theme }) => theme.menu.width}) * 0.4);
46-
${media.lessThan('medium')`
47+
${media.lessThan('medium', true)`
4748
display: none;
4849
`};
4950
`;

src/components/StickySidebar/StickyResponsiveSidebar.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ const StyledStickySidebar = withProps<{ open?: boolean }>(styled.div)`
4343
background: #ffffff;
4444
display: ${props => (props.open ? 'flex' : 'none')};
4545
`};
46+
47+
@media print {
48+
display: none;
49+
}
4650
`;
4751

4852
const FloatingButton = styled.div`
@@ -60,11 +64,16 @@ const FloatingButton = styled.div`
6064
${media.lessThan('small')`
6165
display: flex;
6266
`};
67+
6368
bottom: 44px;
6469
6570
width: 60px;
6671
height: 60px;
6772
padding: 0 20px;
73+
74+
@media print {
75+
display: none;
76+
}
6877
`;
6978

7079
@observer

src/styled-components.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ const {
2626
>;
2727

2828
export const media = {
29-
lessThan(breakpoint) {
29+
lessThan(breakpoint, print?: boolean) {
3030
return (...args) => css`
31-
@media (max-width: ${props => props.theme.breakpoints[breakpoint]}) {
31+
@media ${print ? 'print, ' : ''} screen and (max-width: ${props =>
32+
props.theme.breakpoints[breakpoint]}) {
3233
${(css as any)(...args)};
3334
}
3435
`;

0 commit comments

Comments
 (0)