styled.ts 855 B

123456789101112131415161718192021222324252627282930313233343536
  1. import styled, { css } from 'styled-components';
  2. const baseStyles = css`
  3. border: 1.5px solid ${({ theme }) => theme.colors.black38};
  4. border-radius: 4px;
  5. padding: 7px 15px;
  6. outline: none;
  7. transition: border 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
  8. font-size: 1.2rem;
  9. box-sizing: border-box;
  10. :disabled {
  11. color: ${({ theme }) => theme.colors.black56};
  12. cursor: not-allowed;
  13. }
  14. `;
  15. export const TextArea = styled('textarea')<{
  16. error?: boolean;
  17. shouldFitContainer?: boolean;
  18. }>`
  19. ${baseStyles}
  20. height: 54px;
  21. width: ${(props) => (props.shouldFitContainer ? '100%' : 'auto')};
  22. ${(props) =>
  23. props.error
  24. ? css`
  25. border: 1.5px solid ${({ theme }) => theme.colors.error};
  26. `
  27. : css`
  28. :focus {
  29. border: 1.5px solid ${({ theme }) => theme.colors.primary};
  30. }
  31. `}
  32. `;