Skip to content

Commit

Permalink
chore: use emotion to style SideBySide
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jul 30, 2020
1 parent c0277d9 commit 110180e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
21 changes: 17 additions & 4 deletions src/components/SideBySide.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { Children, Fragment } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { css } from '@emotion/core';
import styles from './SideBySide.module.scss';
import splitUsing from '../utils/splitUsing';
import splitWhen from '../utils/splitWhen';
import { isMdxType } from '../utils/mdx';
Expand Down Expand Up @@ -44,16 +42,31 @@ const SideBySide = ({ className, children, type }) => {
return (
<div
css={css`
display: grid;
grid-template-columns: repeat(2, calc(50% - 0.5rem));
grid-gap: 1rem;
p:last-child {
margin-bottom: 0;
}
@media (max-width: ${BREAKPOINTS[pageLayout]}) {
grid-template-columns: minmax(0, 1fr);
grid-gap: 0;
}
`}
className={cx(className, styles.container)}
className={className}
>
{sections.map(([left, right], idx) => (
<Fragment key={idx}>
<div className={cx({ [styles.spanColumns]: !rendersRightColumn })}>
<div
css={
!rendersRightColumn &&
css`
grid-column: span 2;
`
}
>
{left}
</div>
{rendersRightColumn && <div>{right}</div>}
Expand Down
13 changes: 0 additions & 13 deletions src/components/SideBySide.module.scss

This file was deleted.

0 comments on commit 110180e

Please sign in to comment.