|
| 1 | +$b-toast-background-opacity: alpha($toast-background-color) !default; |
| 2 | + |
| 3 | +.b-toast { |
| 4 | + display: block; |
| 5 | + position: relative; |
| 6 | + max-width: $toast-max-width; |
| 7 | + backface-visibility: hidden; |
| 8 | + background-clip: padding-box; |
| 9 | + z-index: 1; |
| 10 | + |
| 11 | + @include border-radius($toast-border-radius); |
| 12 | + |
| 13 | + .toast { |
| 14 | + // Allow us to override Bootstrap's default toast opacity |
| 15 | + // As they do not provide it as a variable |
| 16 | + background-color: rgba($toast-background-color, $b-toast-background-opacity); |
| 17 | + } |
| 18 | + |
| 19 | + &:not(:last-child) { |
| 20 | + margin-bottom: $toast-padding-x; |
| 21 | + } |
| 22 | + |
| 23 | + &.b-toast-solid { |
| 24 | + .toast { |
| 25 | + background-color: rgba($toast-background-color, 1); |
| 26 | + } |
| 27 | + } |
| 28 | + |
| 29 | + .toast { |
| 30 | + // Override default Bootstrap v4.x opacity of 0 |
| 31 | + // Needed for re-usable fade transition |
| 32 | + .toast-body { |
| 33 | + display: block; // Needed when we use a link as the body element |
| 34 | + } |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +// .b-toast-primary{ |
| 39 | +// color: red |
| 40 | +// } |
| 41 | +// rgba(204,229,255,.85) |
| 42 | +@mixin b-toast-variant($background, $border, $color) { |
| 43 | + // Based on alert-variant mixin |
| 44 | + background-color: rgba(lighten($background, 5%), $b-toast-background-opacity) !important; |
| 45 | + border-color: rgba($border, $b-toast-background-opacity) !important; |
| 46 | + color: $color; |
| 47 | + |
| 48 | + .toast-header { |
| 49 | + color: $color; |
| 50 | + background-color: rgba($background, $b-toast-background-opacity); |
| 51 | + border-bottom-color: rgba($border, $b-toast-background-opacity); |
| 52 | + } |
| 53 | + |
| 54 | + &.b-toast-solid { |
| 55 | + .toast { |
| 56 | + background-color: rgba(lighten($background, 5%), 1); |
| 57 | + } |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +@each $color, $value in $theme-colors { |
| 62 | + .b-toast-#{$color} { |
| 63 | + @include b-toast-variant( |
| 64 | + shift-color($value, $alert-bg-scale), |
| 65 | + shift-color($value, $alert-border-scale), |
| 66 | + shift-color($value, $alert-color-scale) |
| 67 | + ); |
| 68 | + } |
| 69 | +} |
0 commit comments