From 007752dfc41c56646717f20dfe63e32ac874952f Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 23 Jan 2019 19:55:14 +0700 Subject: [PATCH] fix: make padding for md code blocks and code samples consistent --- src/common-elements/tabs.ts | 9 ++++++--- src/components/Markdown/styled.elements.tsx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common-elements/tabs.ts b/src/common-elements/tabs.ts index 7076bdc7..b71a66a5 100644 --- a/src/common-elements/tabs.ts +++ b/src/common-elements/tabs.ts @@ -60,9 +60,13 @@ export const Tabs = styled(ReactTabs)` background: ${({ theme }) => theme.codeSample.backgroundColor}; & > div, & > pre { - padding: 20px; + padding: ${props => props.theme.spacing.unit * 4}px; margin: 0; } + + & > div > pre { + padding: 0; + } } `; @@ -93,8 +97,7 @@ export const SmallTabs = styled(Tabs)` > .react-tabs__tab-panel { & > div, & > pre { - padding: 10px 0; - margin: 0; + padding: ${props => props.theme.spacing.unit * 2} 0; } } `; diff --git a/src/components/Markdown/styled.elements.tsx b/src/components/Markdown/styled.elements.tsx index 5fefdc02..0a2d62bb 100644 --- a/src/components/Markdown/styled.elements.tsx +++ b/src/components/Markdown/styled.elements.tsx @@ -82,7 +82,7 @@ export const StyledMarkdownBlock = styled(PrismDiv as StyledComponent< white-space:${({ theme }) => (theme.typography.code.wrap ? 'pre-wrap' : 'pre')}; background-color: #263238; color: white; - padding: 12px 14px 15px 14px; + padding: ${props => props.theme.spacing.unit * 4}px; overflow-x: auto; line-height: normal; border-radius: 0px