styled.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import styled from 'styled-components';
  2. export const TargetWrapper = styled.div`
  3. display: inline-block;
  4. margin-top: 100px;
  5. margin-left: 100px;
  6. `;
  7. export const TooltipContainer = styled.div`
  8. z-index: 1000;
  9. color: #fff;
  10. border-radius: 2px;
  11. font-size: 1rem;
  12. background-color: rgba(0, 0, 0, 0.6);
  13. min-height: 50px;
  14. min-width: 86px;
  15. box-sizing: border-box;
  16. &[data-placement*='bottom'] {
  17. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.3);
  18. margin-top: 10px;
  19. }
  20. &[data-placement*='top'] {
  21. box-shadow: 0 -4px 8px 0 rgba(0, 0, 0, 0.3);
  22. margin-bottom: 10px;
  23. }
  24. &[data-placement*='left'] {
  25. box-shadow: -4px 0 8px 0 rgba(0, 0, 0, 0.3);
  26. margin-right: 14px;
  27. }
  28. &[data-placement*='right'] {
  29. box-shadow: 4px 0 8px 0 rgba(0, 0, 0, 0.3);
  30. margin-left: 14px;
  31. }
  32. `;
  33. export const Arrow = styled('div')`
  34. position: absolute;
  35. width: 3em;
  36. height: 3em;
  37. box-sizing: border-box;
  38. &[data-placement*='bottom'] {
  39. top: -1px;
  40. left: 0;
  41. margin-top: -0.9em;
  42. width: 3em;
  43. height: 1em;
  44. &::before {
  45. border-width: 0 12px 12px 12px;
  46. border-color: transparent transparent rgba(0, 0, 0, 0.6) transparent;
  47. }
  48. }
  49. &[data-placement*='top'] {
  50. bottom: -1px;
  51. left: 0;
  52. margin-bottom: -0.9em;
  53. width: 3em;
  54. height: 1em;
  55. &::before {
  56. border-width: 12px 12px 0 12px;
  57. border-color: rgba(0, 0, 0, 0.6) transparent transparent transparent;
  58. }
  59. }
  60. &[data-placement*='right'] {
  61. left: -1px;
  62. margin-left: -0.9em;
  63. height: 3em;
  64. width: 1em;
  65. &::before {
  66. border-width: 12px 12px 12px 0;
  67. border-color: transparent rgba(0, 0, 0, 0.6) transparent transparent;
  68. }
  69. }
  70. &[data-placement*='left'] {
  71. right: -1px;
  72. margin-right: -0.9em;
  73. height: 3em;
  74. width: 1em;
  75. &::before {
  76. border-width: 12px 0 12px 12px;
  77. border-color: transparent transparent transparent rgba(0, 0, 0, 0.6);
  78. }
  79. }
  80. &::before {
  81. content: '';
  82. margin: auto;
  83. display: block;
  84. width: 0;
  85. height: 0;
  86. border-style: solid;
  87. }
  88. `;