_tooltips.scss 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. .tooltip {
  2. position: relative;
  3. & {
  4. &:before,
  5. &:after {
  6. visibility: hidden;
  7. opacity: 0;
  8. transition: .3s opacity;
  9. pointer-events: none;
  10. z-index: 100;
  11. }
  12. &:before {
  13. content: attr(data-title);
  14. position: absolute;
  15. display: block;
  16. bottom: calc(100% + .5rem);
  17. left: 50%;
  18. background: $color-text;
  19. color: $color-white;
  20. white-space: nowrap;
  21. line-height: 1;
  22. font-weight: $font-weight-normal;
  23. font-size: $font-size-h6;
  24. font-family: $font-family-base;
  25. padding: $gap-2;
  26. border-radius: $border-radius;
  27. transform: translateX(-50%);
  28. }
  29. &:after {
  30. content: '';
  31. width: 0;
  32. height: 0;
  33. border: $gap-1 solid transparent;
  34. border-top-color: $color-text;
  35. position: absolute;
  36. left: calc(50% - #{$gap-1});
  37. bottom: 100%;
  38. }
  39. &:hover {
  40. &:before,
  41. &:after {
  42. opacity: 1;
  43. visibility: visible;
  44. transition-delay: .3s;
  45. }
  46. }
  47. }
  48. }
  49. .tooltip-monospaced {
  50. & {
  51. &:before {
  52. font-family: $font-family-monospace;
  53. font-size: $font-size-h6;
  54. }
  55. }
  56. }