Skip to content

Commit f326c48

Browse files
committed
Show TOC on medium size desktop view
1 parent 772c613 commit f326c48

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/components/post/PostToc.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import palette from '../../lib/styles/palette';
44
import Sticky from '../common/Sticky';
55
import { usePostViewerState } from './PostViewerProvider';
66
import { getScrollTop } from '../../lib/utils';
7-
import media from '../../lib/styles/media';
7+
import media, { mediaQuery } from '../../lib/styles/media';
88

99
const Wrapper = styled.div`
1010
position: relative;
1111
margin-top: 2rem;
12-
${media.xlarge} {
12+
${mediaQuery(1365)} {
1313
display: none;
1414
}
1515
`;
@@ -21,6 +21,9 @@ const Positioner = styled.div`
2121
const PostTocBlock = styled(Sticky)`
2222
width: 240px;
2323
margin-left: 5rem;
24+
${media.xlarge} {
25+
margin-left: 3rem;
26+
}
2427
border-left: 2px solid ${palette.gray2};
2528
padding-left: 0.75rem;
2629
padding-right: 0.75rem;

src/lib/styles/media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const mediaQuery = (maxWidth: number) => `
1+
export const mediaQuery = (maxWidth: number) => `
22
@media (max-width: ${maxWidth}px)
33
`;
44

0 commit comments

Comments
 (0)