|
| 1 | +//== Some Bootstrap variables for Tooltips |
| 2 | +// |
| 3 | +//## |
| 4 | + |
| 5 | +// the following lines can be deleted if the variables are already declared |
| 6 | +$white: #fff; |
| 7 | +$red: #d9534f; |
| 8 | +$orange: #f0ad4e; |
| 9 | +$green: #5cb85c; |
| 10 | +$blue: #0275d8; |
| 11 | +$teal: #5bc0de; |
| 12 | + |
| 13 | +$brand-primary: $blue; |
| 14 | +$brand-success: $green; |
| 15 | +$brand-info: $teal; |
| 16 | +$brand-warning: $orange; |
| 17 | +$brand-danger: $red; |
| 18 | + |
| 19 | +// |
| 20 | +$tooltip-color: $white; |
| 21 | + |
| 22 | +// |
| 23 | +// Tooltip primary background color |
| 24 | +$tooltip-primary-bg: $brand-primary !default; |
| 25 | +// Tooltip success background color |
| 26 | +$tooltip-success-bg: $brand-success !default; |
| 27 | +// Tooltip info background color |
| 28 | +$tooltip-info-bg: $brand-info !default; |
| 29 | +// Tooltip warning background color |
| 30 | +$tooltip-warning-bg: $brand-warning !default; |
| 31 | +// Tooltip danger background color |
| 32 | +$tooltip-danger-bg: $brand-danger !default; |
| 33 | + |
| 34 | + |
| 35 | +//== Tooltip Custom Mixin |
| 36 | +// |
| 37 | +//## |
| 38 | +@mixin tooltip-custom($bg-color, $color: $tooltip-color) { |
| 39 | + |
| 40 | + .tooltip-inner { |
| 41 | + background-color: $bg-color; |
| 42 | + @if $color != $tooltip-color { |
| 43 | + color: $color; |
| 44 | + } |
| 45 | + } |
| 46 | + |
| 47 | + &.tooltip-top, |
| 48 | + &.bs-tether-element-attached-bottom { |
| 49 | + .tooltip-inner::before { |
| 50 | + border-top-color: $bg-color; |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + &.tooltip-right, |
| 55 | + &.bs-tether-element-attached-left { |
| 56 | + .tooltip-inner::before { |
| 57 | + border-right-color: $bg-color; |
| 58 | + } |
| 59 | + } |
| 60 | + |
| 61 | + &.tooltip-bottom, |
| 62 | + &.bs-tether-element-attached-top { |
| 63 | + .tooltip-inner::before { |
| 64 | + border-bottom-color: $bg-color; |
| 65 | + } |
| 66 | + } |
| 67 | + |
| 68 | + &.tooltip-left, |
| 69 | + &.bs-tether-element-attached-right { |
| 70 | + .tooltip-inner::before { |
| 71 | + border-left-color: $bg-color; |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | +} |
| 76 | + |
| 77 | + |
| 78 | +//== Styles for predefined Tooltip Custom Classes |
| 79 | +// |
| 80 | +//## |
| 81 | +.tooltip-primary { |
| 82 | + @include tooltip-custom($tooltip-primary-bg); |
| 83 | +} |
| 84 | + |
| 85 | +.tooltip-success { |
| 86 | + @include tooltip-custom($tooltip-success-bg); |
| 87 | +} |
| 88 | + |
| 89 | +.tooltip-info { |
| 90 | + @include tooltip-custom($tooltip-info-bg); |
| 91 | +} |
| 92 | + |
| 93 | +.tooltip-warning { |
| 94 | + @include tooltip-custom($tooltip-warning-bg); |
| 95 | +} |
| 96 | + |
| 97 | +.tooltip-danger { |
| 98 | + @include tooltip-custom($tooltip-danger-bg); |
| 99 | +} |
| 100 | + |
0 commit comments