@primer/react
Version:
An implementation of GitHub's Primer Design System using React
27 lines (24 loc) • 561 B
JavaScript
import styled from 'styled-components';
import sx from './sx.js';
const VisuallyHidden = styled.span.withConfig({
displayName: "_VisuallyHidden__VisuallyHidden",
componentId: "sc-11jhm7a-0"
})(["", ""], ({
isVisible = false
}) => {
if (isVisible) {
return sx;
}
return `
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
`;
});
export { VisuallyHidden as default };