# All files / components/Input/styles InputStyles.js

50% Statements 2/4
0% Branches 0/6
0% Functions 0/2
50% Lines 2/4

    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

    5x

    5x

     import styled, { css } from 'styled-components';
    import get from 'extensions/themeGet';

    const InputStyles = styled.input`
      letter-spacing: 0.02em;
      line-height: 1.5;
      font-size: 14px;
      font-family: ${get('fonts.brand')};
      transition: all 0.2s ease;
      padding: ${get('spacing.medium')};
      border-width: ${get('thicknesses.normal')};
      border-style: solid;

      color: ${get('colors.text.default')};
      background: ${get('colors.background.default')};
      opacity: 1;
      border-color: ${get('colors.border.light')};

      outline: none;
      width: 100%;

      &:focus {
        box-shadow: inset 0 -5px 0 ${get('colors.primary.light')};
        border-color: ${get('colors.border.medium')};
      }

      &:disabled {
        background: ${get('colors.background.disabled')};
        border-color: ${get('colors.border.medium')};
        opacity: 0.5;
        color: ${get('colors.text.disabled')};
      }

      &::placeholder {
        opacity: 0.5;
      }

      ${({ visited, theme }) =>
        visited
          ? css`
              &:invalid {
                box-shadow: inset 0 -5px 0 ${get('colors.negative.light')};
                border-color: ${get('colors.negative.border')};
              }
            `
          : ''} ${({ invalid, error, theme }) =>
          invalid || error
            ? `
        box-shadow: inset 0 -5px ${get('colors.negative.light')};
        border-color: ${get('colors.negative.border')};
        `
            : ''};
    `;

    InputStyles.Small = InputStyles.extend`
      font-size: 12px;
      padding: ${get('spacing.small')};
    `;

    export default InputStyles;