Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #729 from guardian/sa-hide-above-below
Browse files Browse the repository at this point in the history
Supporting hiding above and below breakpoints
  • Loading branch information
SiAdcock authored Feb 16, 2021
2 parents 1496525 + ed3161a commit 0c0905c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/components/layout/components/hide/hide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Hide = ({ children, above, below }: HideProps) => {
}
if (above) {
whenToHide = css`
${whenToHide}
${from[above]} {
display: none;
}
Expand Down
14 changes: 14 additions & 0 deletions src/core/components/layout/stories/hide/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ export const above = () => (
above.story = {
name: 'above',
};

export const between = () => (
<Container>
<Hide below="tablet" above="leftCol">
<div css={contents}>
Will only appear between desktop and leftCol
</div>
</Hide>
</Container>
);

between.story = {
name: 'between',
};

0 comments on commit 0c0905c

Please sign in to comment.