tooltip.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //@import '../theme/variables.scss';
  2. @import "./animation.scss";
  3. @import './variables.scss';
  4. $module: #{$prefix}-tooltip;
  5. $module-icon: #{$module}-icon-arrow;
  6. @keyframes #{$module}-zoomIn {
  7. from {
  8. opacity: $motion-zoom_opacity-from;
  9. transform: scale($motion-zoom_scale-from, $motion-zoom_scale-from);
  10. }
  11. 50% {
  12. opacity: $motion-zoom_opacity-to;
  13. }
  14. }
  15. @keyframes #{$module}-bounceIn {
  16. from {
  17. opacity: 0;
  18. transform: scale(0.6, 0.6);
  19. }
  20. 70% {
  21. opacity: 1;
  22. transform: scale(1.01, 1.01);
  23. }
  24. to {
  25. opacity: 1;
  26. transform: scale(1, 1);
  27. animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  28. }
  29. }
  30. @keyframes #{$module}-zoomOut {
  31. from {
  32. opacity: $motion-zoom_opacity-to;
  33. }
  34. 60% {
  35. opacity: $motion-zoom_opacity-from;
  36. transform: scale($motion-zoom_scale-from, $motion-zoom_scale-from);
  37. }
  38. to {
  39. opacity: $motion-zoom_opacity-from;
  40. }
  41. }
  42. .#{$module} {
  43. &-wrapper {
  44. position: relative;
  45. background-color: $color-tooltip-bg-default;
  46. color: $color-tooltip-text-default;
  47. // z-index: $z-tooltip; // TODO z-index定义需要收敛
  48. border-radius: $radius-tooltip;
  49. padding-top: $spacing-tooltip_content-paddingTop;
  50. padding-right: $spacing-tooltip_content-paddingRight;
  51. padding-bottom: $spacing-tooltip_content-paddingBottom;
  52. padding-left: $spacing-tooltip_content-paddingLeft;
  53. font-size: $font-tooltip-fontSize;
  54. left: 0;
  55. top: 0;
  56. @include font-size-regular;
  57. opacity: 0;
  58. max-width: $width-tooltip;
  59. &-show {
  60. opacity: 1;
  61. }
  62. }
  63. &-trigger {
  64. display: inline-block;
  65. width: auto;
  66. height: auto;
  67. }
  68. &-with-arrow {
  69. // padding: 12px;
  70. display: flex;
  71. align-items: center;
  72. justify-content: center;
  73. box-sizing: border-box;
  74. }
  75. &-animation-show{
  76. animation: #{$module}-zoomIn $animation_duration-tooltip_in $animation_function-tooltip_in;
  77. animation-fill-mode: forwards;
  78. }
  79. &-animation-hide{
  80. animation: #{$module}-zoomOut $animation_duration-tooltip_out $animation_function-tooltip_out;
  81. animation-fill-mode: forwards;
  82. }
  83. }
  84. @import './arrow.scss';
  85. @import './rtl.scss';