All files / components/Form/CheckBox StyledCheckBox.js

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35        13x       13x                                             13x      
import styled from 'styled-components';
import { bool } from 'prop-types';
import { miscInputStyles } from '../commonFormStyles';
 
const propTypes = {
  invalid: bool.isRequired,
};
 
const StyledCheckBox = styled.input.attrs({
  type: 'checkbox',
})`
  ${miscInputStyles}
  border-radius: 0.25em;
  position: relative;
  &:checked {
    &:after {
      content: '';
      position: absolute;
      top: 25%;
      left: 0;
      right: 0;
      margin: auto;
      width: 50%;
      height: 25%;
      transform: rotate(-50deg);
      border-bottom: 0.125em solid #fff;
      border-left: 0.125em solid #fff;
    }
  }
`;
 
StyledCheckBox.propTypes = propTypes;
 
export default StyledCheckBox;