Skip to content

Commit

Permalink
feat: Change how section backgrounds are rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jun 23, 2020
1 parent 26763ac commit e6d1fe3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
12 changes: 5 additions & 7 deletions src/components/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import styles from './Section.module.scss';

const Section = ({ backgroundBanner, children, className }) => {
return (
<div className={styles.section}>
<div
className={cx(
{ [styles.backgroundBanner]: backgroundBanner },
className
)}
/>
<div
className={cx(styles.section, {
[styles.backgroundBanner]: backgroundBanner,
})}
>
{children}
</div>
);
Expand Down
16 changes: 7 additions & 9 deletions src/components/Section.module.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
.section {
position: relative;
}
--surface-background-color: var(--secondary-surface-background-color);

.backgroundBanner {
position: absolute;
top: -2rem;
bottom: -2rem;
left: -2rem;
right: -2rem;
z-index: -1;
position: relative;
background-color: var(--secondary-background-color);

&.backgroundBanner {
margin: -2rem;
padding: 2rem;
}
}

0 comments on commit e6d1fe3

Please sign in to comment.