# All files / components/Radio/styles RadioLabel.js

66.67% Statements 2/3
0% Branches 0/2
0% Functions 0/1
66.67% Lines 2/3

    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
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48

    4x
    4x

     import styled from 'styled-components';
    import get from 'extensions/themeGet';
    import icons from 'components/Icon/icons';

    const SIZE = '1.3em';
    const PADDING = '0.2em';

    export default styled.label`
      display: block;
      cursor: pointer;
      position: relative;
      padding: ${PADDING} 0 ${PADDING} 2.1em;
      line-height: 1.5em;

      /* the check */

      &::before {
        content: ${({ checked }) => (checked ? `"${icons('checkmark')}"` : '""')};
        color: ${get('colors.text.inverted')};
        font-family: ${get('fonts.icon')};
        text-align: center;
        width: ${SIZE};
        height: ${SIZE};
        display: block;
        position: absolute;
        top: calc(${PADDING} + ${SIZE} / 2);
        left: calc(${SIZE} / 2);
        transform: translate(-50%, -50%);
        z-index: 1;
      }

      /* the bubble */

      &::after {
        content: '';
        border: ${get('thicknesses.wide')} solid ${get('colors.primary.dark')};
        border-radius: 100%;
        width: ${SIZE};
        height: ${SIZE};
        display: block;
        position: absolute;
        top: calc(${PADDING} + ${SIZE} / 2);
        left: calc(${SIZE} / 2);
        transform: translate(-50%, -50%);
        transition: all 0.2s ease;
      }
    `;