@import "settings.global"; @mixin tooltip { position: relative; overflow: visible; &:before, &:after { visibility: hidden; z-index: $z-over-page; } &:before { content: ''; position: absolute; border: $tooltip-arrow-width solid transparent; } &:after { visibility: hidden; content: attr(aria-label); position: absolute; padding: 0.25em 0.5em; border: $tooltip-body-border-width $tooltip-body-border-style $tooltip-body-border-color; border-radius: $border-radius; background-color: $tooltip-body-background-color; color: $tooltip-body-color; white-space: nowrap; } &:hover:before, &:hover:after { visibility: visible; } } @mixin tooltip--top { &:before { border-top-color: $tooltip-body-border-color; top: 0%; left: 50%; transform: translate(-50%, -1em); } &:after { top: 0%; left: 50%; transform: translate(-50%, -3em); } } @mixin tooltip--right { &:before { border-right-color: $tooltip-body-border-color; top: 50%; left: 100%; transform: translate(0em, -50%); } &:after { top: 50%; left: 100%; transform: translate(1em, -50%); } } @mixin tooltip--bottom { &:before { border-bottom-color: $tooltip-body-border-color; bottom: 0%; left: 50%; transform: translate(-50%, 1em); } &:after { bottom: 0%; left: 50%; transform: translate(-50%, 3em); } } @mixin tooltip--left { &:before { border-left-color: $tooltip-body-border-color; top: 50%; right: 100%; transform: translate(0em, -50%); } &:after { top: 50%; right: 100%; transform: translate(-1em, -50%); } }