# All files / components/RadioGroup/styles RadioGroupButtonLabel.js

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/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
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77

    5x

    5x

    5x

     import styled from 'styled-components';
    import get from 'extensions/themeGet';
    import Input from './RadioGroupButtonInput';

    const RadioGroupButtonLabel = styled.label`
      opacity: 0.5;
      border-width: ${get('thicknesses.normal')};
      border-style: solid;
      border-color: ${get('colors.border.medium')};
      margin-right: -1px;
      padding: 1em 1.4em;
      cursor: pointer;
      position: relative;
      display: flex;
      flex-direction: column;
      align-content: flex-start;
      background: ${get('colors.background.default')};
      color: ${get('colors.text.default')};
      transition: opacity 0.2s ease;
      text-transform: uppercase;
      font-weight: bold;
      font-size: 1em;
      height: 100%;

      &::after {
        content: '';
        background: ${get('colors.primary.default')};
        width: calc(100% + 2px);
        height: 0;
        position: absolute;
        bottom: -1px;
        left: -1px;
        display: block;
        transition: height 0.2s ease, opacity 0.2s ease;
      }

      ${Input}:hover + & {
        border-color: ${get('colors.primary.default')};
        &::after {
          height: 5px;
          opacity: 0.5;
        }
      }

      ${Input}:focus + & {
        border-color: ${get('colors.border.medium')};
      }

      ${Input}:checked:hover + & {
        border-color: ${get('colors.primary.default')};
      }

      ${Input}:checked + & {
        opacity: 1;
        &::after {
          height: 5px;
        }
      }
    `;

    RadioGroupButtonLabel.Small = RadioGroupButtonLabel.extend`
      font-size: 0.8em;
      padding: 0.83em 1em;
      font-weight: normal;

      ${Input}:hover + &::after,
      ${Input}:checked + &::after {
        height: 2px;
      }
    `;

    RadioGroupButtonLabel.Large = RadioGroupButtonLabel.extend`
      padding: ${get('spacing.large')};
    `;

    export default RadioGroupButtonLabel;