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

0% Statements 0/11
0% Branches 0/10
0% Functions 0/3
0% Lines 0/6

    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

     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: calc(${get('spacing.medium')} - 1px) ${get('spacing.medium')};
      border-width: ${get('thicknesses.wide')};
      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.disabled')};
        opacity: 1;
        color: ${get('colors.text.disabled')};
      }

      &::placeholder {
        opacity: 0.5;
      }

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

    InputStyles.Small = styled(InputStyles)`
      font-size: 12px;
      padding: calc(var(--spacing-extra-small) - 1px) var(--spacing-extra-small);
    `;

    export default InputStyles;