styled.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import styled, { css } from 'styled-components';
  2. import { color } from '../../constants/style';
  3. export const Container = 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 =>
  33. props.variant === 'left'
  34. ? css`
  35. border-top-left-radius: 4px;
  36. border-bottom-left-radius: 4px;
  37. margin-right: 1px;
  38. :after {
  39. content: '';
  40. top: 0;
  41. bottom: 0;
  42. margin: auto;
  43. width: 0;
  44. height: 0;
  45. border-top: 5px solid transparent;
  46. border-bottom: 5px solid transparent;
  47. border-right: 5px solid #000000;
  48. position: absolute;
  49. transform-origin: 50%;
  50. }
  51. :hover:after {
  52. border-right: 5px solid ${color.black38};
  53. }
  54. `
  55. : css`
  56. border-top-right-radius: 4px;
  57. border-bottom-right-radius: 4px;
  58. margin-left: 1px;
  59. :after {
  60. content: '';
  61. top: 0;
  62. bottom: 0;
  63. margin: auto;
  64. width: 0;
  65. height: 0;
  66. border-top: 5px solid transparent;
  67. border-bottom: 5px solid transparent;
  68. border-left: 5px solid #000000;
  69. position: absolute;
  70. }
  71. :hover:after {
  72. border-left: 5px solid ${color.black38};
  73. }
  74. `}
  75. `;