Skip to content

Commit

Permalink
Add VisuallyHidden atom component
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonEspinosa committed Sep 17, 2022
1 parent a1f4e74 commit d471a73
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions admin/src/components/atoms/VisuallyHidden.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from '@emotion/styled';

/** A component which hides its children. The children will still be available for screen readers.
* @see {@link https://www.a11yproject.com/posts/how-to-hide-content/} for further information.
*/
const VisuallyHidden = styled.span`
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
`;

export default VisuallyHidden;

0 comments on commit d471a73

Please sign in to comment.