styled.ts 2.0 KB

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