styled.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import styled, { css } from 'styled-components';
  2. import { color } from '../../constants/style';
  3. export const Wrapper = styled.div`
  4. display: inline-flex;
  5. align-items: center;
  6. `;
  7. export const Text = styled.span`
  8. font-size: 12px;
  9. margin: 8px;
  10. `;
  11. export const Input = styled.input`
  12. background-color: ${color['light-gray']};
  13. outline: none;
  14. border: none;
  15. width: 70px;
  16. height: 30px;
  17. text-align: center;
  18. box-sizing: border-box;
  19. padding: 5px;
  20. `;
  21. export const ArrowButton = styled('button')<{variant: string}>`
  22. height: 30px;
  23. width: 26px;
  24. outline: none;
  25. border: none;
  26. background-color: ${color['light-gray']};
  27. cursor: pointer;
  28. position: relative;
  29. display: flex;
  30. align-items: center;
  31. justify-content: center;
  32. ${props => (props.variant === 'left' ? css`
  33. border-top-left-radius: 4px;
  34. border-bottom-left-radius: 4px;
  35. margin-right: 1px;
  36. :after {
  37. content: '';
  38. top: 0;
  39. bottom: 0;
  40. margin: auto;
  41. width: 0;
  42. height: 0;
  43. border-top: 5px solid transparent;
  44. border-bottom: 5px solid transparent;
  45. border-right: 5px solid #000000;
  46. position: absolute;
  47. transform-origin: 50%;
  48. }
  49. :hover:after {
  50. border-right: 5px solid ${color.black38};
  51. }
  52. ` : css`
  53. border-top-right-radius: 4px;
  54. border-bottom-right-radius: 4px;
  55. margin-left: 1px;
  56. :after {
  57. content: '';
  58. top: 0;
  59. bottom: 0;
  60. margin: auto;
  61. width: 0;
  62. height: 0;
  63. border-top: 5px solid transparent;
  64. border-bottom: 5px solid transparent;
  65. border-left: 5px solid #000000;
  66. position: absolute;
  67. }
  68. :hover:after {
  69. border-left: 5px solid ${color.black38};
  70. }
  71. `)}
  72. `;