@import "../tokens/positioning"; @import "../tokens/colors"; $tooltip_shadow: rgba(60, 106, 172, 0.18); @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } [class^="pb_tooltip_kit"] { .tooltip_tooltip { display: block; opacity: 0; position: absolute; left: $offscreen; top: 0; animation-name: fadeIn; animation-duration: 150ms; animation-timing-function: linear; animation-fill-mode: forwards; &.flipped { margin-top: 15px; .arrow { border-color: transparent transparent $white transparent; transform: rotate(180deg); } } .arrow { content: " "; position: absolute; top: 100%; left: calc(50% - 10px); border-color: $white transparent transparent transparent; border-style: solid; border-width: 10px; margin-bottom: 50px; } &.show { opacity: 1; z-index: $z_9; margin-bottom: $space_sm; background-color: $white; padding: $space_xs $space_sm; box-shadow: $shadow_deeper; border-radius: $border_rad_light; &.fade_out { animation-name: fadeOut; animation-duration: 150ms; animation-timing-function: linear; animation-fill-mode: forwards; } } } &[class*=_dark]{ .tooltip_tooltip{ color: $white; background-color: rgba($black, $opacity_9); .arrow { border-color: $black transparent transparent transparent; opacity: $opacity_9; } &.flipped { .arrow { border-color: transparent transparent $black transparent; opacity: $opacity_9; } } } } } // Right [class^="pb_tooltip_kit"] .tooltip_tooltip { $arrow_vertical_offset: calc(50% - #{$space_xs * 1.2}); &[data-popper-placement="right"] { box-shadow: -8px 0 28px 0 $tooltip_shadow; margin: 0 0 0 $space_sm; .arrow { left: -18px; right: auto; margin-bottom: 0; top: $arrow_vertical_offset; transform: rotate(90deg); } &.flipped .arrow { transform: rotate(270deg); } } &[data-popper-placement="bottom"] { box-shadow: 0 -12px 28px 0 $tooltip_shadow; margin: $space_sm 0 0 0; .arrow { top: -18px; margin-bottom: 0; transform: rotate(180deg); } &.flipped .arrow { transform: rotate(0deg); } } &[data-popper-placement="left"] { box-shadow: 8px 0 28px 0 $tooltip_shadow; margin: 0 $space_sm 0 0; .arrow { margin-bottom: 0; right: -18px; left: auto; top: $arrow_vertical_offset; transform: rotate(270deg); } &.flipped .arrow { transform: rotate(90deg); } } }