All files / components/search styles.ts

100% Statements 10/10
100% Branches 0/0
100% Functions 5/5
100% Lines 10/10

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 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 78 79 80      4x 6x                           4x 6x                         4x 6x                     4x 6x                                       4x 1x                          
import styled, { css } from 'styled-components';
import media from 'styled-media-query';
 
export const Container = styled.form`
  ${({ theme }) => css`
    width: min(100%, 40rem);
    position: relative;
    margin-top: ${theme.spacings.medium};
    margin-bottom: ${theme.spacings.large};
 
    ${media.greaterThan('medium')`
      width: min(100%, 54rem);
      margin-top: calc(${theme.spacings.large} * 1.5);
      margin-bottom: ${theme.spacings.xlarge};
    `}
  `}
`;
 
export const Label = styled.label`
  ${({ theme }) => css`
    width: 100%;
    display: flex;
    flex-direction: column;
    font-size: ${theme.font.sizes.medium};
    color: ${theme.colors.white};
 
    ${media.greaterThan('medium')`
      font-size: ${theme.font.sizes.large};
    `}
  `}
`;
 
export const InputWrapper = styled.div`
  ${({ theme }) => css`
    display: flex;
    width: 100%;
    margin-top: ${theme.spacings.xxsmall};
 
    ${media.greaterThan('medium')`
      margin-top: ${theme.spacings.xsmall};
    `}
  `}
`;
 
export const Input = styled.input`
  ${({ theme }) => css`
    width: 100%;
    background-color: ${theme.colors.white};
    padding: ${theme.spacings.xsmall};
    color: ${theme.colors.bg};
    font-size: ${theme.font.sizes.medium};
    border: 0;
    border-radius: 0 ${theme.border.radius} ${theme.border.radius} 0;
 
    &::placeholder {
      color: ${theme.colors.bg};
    }
 
    ${media.greaterThan('medium')`
      padding: ${theme.spacings.small};
      font-size: ${theme.font.sizes.large};
    `}
  `}
`;
 
export const Error = styled.span`
  ${({ theme }) => css`
    position: absolute;
    z-index: 1;
    top: calc(100% + ${theme.spacings.xxsmall});
    color: ${theme.colors.error};
    font-size: ${theme.font.sizes.medium};
 
    ${media.greaterThan('medium')`
      font-size: ${theme.font.sizes.large};
      top: calc(100% + ${theme.spacings.xsmall});
    `}
  `}
`;