diff options
author | Fred Carlsen <fred@sjelfull.no> | 2018-12-07 20:48:10 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-07 20:48:10 +0800 |
commit | b68f3eb7720f1ab106d9903b0eef6c27f5149734 (patch) | |
tree | 842614568726c9cb94baa81eab51cadcffb742cd /packages/website/ts/@next/components/text.tsx | |
parent | 47e8bc8e43594806d025af50661bae266c06643b (diff) | |
download | dexon-0x-contracts-b68f3eb7720f1ab106d9903b0eef6c27f5149734.tar.gz dexon-0x-contracts-b68f3eb7720f1ab106d9903b0eef6c27f5149734.tar.zst dexon-0x-contracts-b68f3eb7720f1ab106d9903b0eef6c27f5149734.zip |
Break heading on why properly
Diffstat (limited to 'packages/website/ts/@next/components/text.tsx')
-rw-r--r-- | packages/website/ts/@next/components/text.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/website/ts/@next/components/text.tsx b/packages/website/ts/@next/components/text.tsx index 8584a093c..de31679b2 100644 --- a/packages/website/ts/@next/components/text.tsx +++ b/packages/website/ts/@next/components/text.tsx @@ -27,9 +27,13 @@ const StyledHeading = styled.h1<HeadingProps>` margin-bottom: ${props => !props.isNoMargin && '30px'}; text-align: ${props => props.isCentered && 'center'}; font-weight: 300; + max-width: var(--desktopMaxWidth, none); + margin-left: ${props => props.isCentered && 'auto'}; + margin-right: ${props => props.isCentered && 'auto'}; @media (max-width: 768px) { text-align: center; + max-width: var(--mobileMaxWidth, none); } `; @@ -37,9 +41,10 @@ export const Heading: React.StatelessComponent<HeadingProps> = props => { const { asElement = 'h1', children, + ...style } = props; const Component = StyledHeading.withComponent(asElement); - return <Component {...props}>{children}</Component>; + return <Component style={{...style}} {...props}>{children}</Component>; }; // No need to declare it twice as Styled then rewrap as a stateless comp |