Select.styled.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import styled from 'styled-components';
  2. interface Props {
  3. selectSize: 'M' | 'L';
  4. isLive?: boolean;
  5. minWidth?: string;
  6. }
  7. export const Select = styled.select<Props>`
  8. height: ${(props) => (props.selectSize === 'M' ? '32px' : '40px')};
  9. border: 1px ${(props) => props.theme.selectStyles.borderColor.normal} solid;
  10. border-radius: 4px;
  11. font-size: 14px;
  12. width: 100%;
  13. padding-left: ${(props) => (props.isLive ? '36px' : '12px')};
  14. padding-right: 16px;
  15. color: ${(props) => props.theme.selectStyles.color.normal};
  16. min-width: ${({ minWidth }) => minWidth || 'auto' };
  17. background-image: url('data:image/svg+xml,%3Csvg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M1 1L5 5L9 1" stroke="%23454F54"/%3E%3C/svg%3E%0A') !important;
  18. background-repeat: no-repeat !important;
  19. background-position-x: calc(100% - 8px) !important;
  20. background-position-y: 55% !important;
  21. appearance: none !important;
  22. &:hover {
  23. color: ${(props) => props.theme.selectStyles.color.hover};
  24. border-color: ${(props) => props.theme.selectStyles.borderColor.hover};
  25. }
  26. &:focus {
  27. outline: none;
  28. color: ${(props) => props.theme.selectStyles.color.active};
  29. border-color: ${(props) => props.theme.selectStyles.borderColor.active};
  30. }
  31. &:disabled {
  32. color: ${(props) => props.theme.selectStyles.color.disabled};
  33. border-color: ${(props) => props.theme.selectStyles.borderColor.disabled};
  34. cursor: not-allowed;
  35. }
  36. `;