$z-index-tooltip: 11; .tooltip, .tooltip-click{ position: relative; float: left; /* Default Tooltip Top */ &-content { display: block; visibility: hidden; text-align: left; opacity: 0; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 0); max-width: 400px; width: 100%; background: $white; border: 1px solid $gray; @include padding(12px); border-radius: 4px; z-index: $z-index-tooltip; box-shadow: 0 0 8px -1px $gray; transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out; &:after, &:before { content: ''; display: block; position: absolute; left: 50%; transform: translate(-50%, 0); top: 100%; width: 0; height: 0; border-style: solid; } &:after { left: 50%; border-color: $white transparent transparent transparent; border-width: 10px; } &:before { border-color: $gray transparent transparent transparent; border-width: 11px; } /* Tooltip Left */ &.left { bottom: 50%; right: calc(100% + 10px); left: auto; transform: translate(0, 50%); &:after, &:before { left: 100%; top: 50%; transform: translate(0, -50%); } &:after { border-color: transparent transparent transparent $white; } &:before { border-color: transparent transparent transparent $gray; } } /* Tooltip Right */ &.right { bottom: 50%; left: calc(100% + 10px); transform: translate(0, 50%); &:after, &:before { right: 100%; left: auto; top: 50%; transform: translate(0, -50%); } &:after { border-color: transparent $white transparent transparent; } &:before { border-color: transparent $gray transparent transparent; } } /* Tooltip Bottom */ &.bottom { bottom: auto; top: calc(100% + 10px); left: 50%; transform: translate(-50%, 0); &:after, &:before { bottom: 100%; top: auto; transform: translate(-50%); } &:after { left: 50%; border-color: transparent transparent $white transparent; } &:before { border-color: transparent transparent $gray transparent; } } /* Define Fixed Widths, otherwise width will be width of parent size */ &.width-400 { width: 400px; } &.width-300 { width: 300px; } @media (max-width: $screen-xs-max) { width: 75vw !important; } } &-info { position: relative; min-width: 225px; &-close-btn{ height: 30px; width: 30px; position: absolute; top: -10px; right: -10px; line-height: 50px; z-index: 10; cursor: pointer; &:before, &:after { transform: rotate(-45deg); content: ''; position: absolute; top: 50%; left: 50%; margin-left: -10px; display: block; height: 1px; width: 50%; background-color: $gray; } &:after { transform: rotate(45deg); } } } &-icon { width: 15px; height: 15px; display: inline-block; svg { width: 100%; height: 100%; vertical-align: middle; } } } .tooltip { &:hover { .tooltip-content { opacity: 1; visibility: visible; } } }