Skip to content
Permalink
Browse files

feat(toast): add support for scoped styles (#3963)

  • Loading branch information...
tmorehouse authored and jackmu95 committed Aug 28, 2019
1 parent 77ad6b9 commit ca1b5debca5966ea032c805d544aa9274ae6ed42
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/components/toast/toast.js
@@ -407,6 +407,14 @@ export const BToast = /*#__PURE__*/ Vue.extend({
return h()
}
const name = `b-toast-${this._uid}`
const $parent = this.$parent
// If scoped styles are applied, and the toast is not static,
// Make sure hte scoped style data attribute is applied
const scopeAttrs =
!this.static && $parent && $parent.$options._scopeId
? { [`${[$parent.$options._scopeId]}`]: '' }
: {}

return h(
Portal,
{
@@ -427,6 +435,7 @@ export const BToast = /*#__PURE__*/ Vue.extend({
staticClass: 'b-toast',
class: this.bToastClasses,
attrs: {
...scopeAttrs,
id: this.safeId('_toast_outer'),
role: this.isHiding ? null : this.isStatus ? 'status' : 'alert',
'aria-live': this.isHiding ? null : this.isStatus ? 'polite' : 'assertive',

0 comments on commit ca1b5de

Please sign in to comment.
You can’t perform that action at this time.