diff --git a/addon/templates/components/paper-toast.hbs b/addon/templates/components/paper-toast.hbs index 73dd1d1e9..08a9fc84e 100644 --- a/addon/templates/components/paper-toast.hbs +++ b/addon/templates/components/paper-toast.hbs @@ -1,5 +1,5 @@ {{#ember-wormhole to=destinationId}} - {{#paper-toast-inner swipe=swipe swipeToClose=swipeToClose onClose=onClose top=top left=left capsule=capsule}} + {{#paper-toast-inner swipe=swipe swipeToClose=swipeToClose onClose=onClose top=top left=left capsule=capsule class=class}} {{yield (hash text=(component "paper-toast-text") )}} diff --git a/addon/templates/components/paper-toaster.hbs b/addon/templates/components/paper-toaster.hbs index bfef4c458..137c29470 100644 --- a/addon/templates/components/paper-toaster.hbs +++ b/addon/templates/components/paper-toaster.hbs @@ -4,6 +4,7 @@ onClose=(action onClose activeToast) position=activeToast.position duration=activeToast.duration + class=activeToast.toastClass parent=parent as |toast|}} {{#if activeToast.componentName}} {{component activeToast.componentName}} diff --git a/tests/dummy/app/controllers/demo/toast.js b/tests/dummy/app/controllers/demo/toast.js index 2bee2bad2..33e611779 100644 --- a/tests/dummy/app/controllers/demo/toast.js +++ b/tests/dummy/app/controllers/demo/toast.js @@ -7,6 +7,7 @@ export default Controller.extend({ positionX: 'left', positionY: 'bottom', toastText: 'Hello world', + toastClass: '', paperToaster: inject.service(), @@ -21,13 +22,15 @@ export default Controller.extend({ // BEGIN-SNIPPET toaster openServiceToast() { this.get('paperToaster').show(this.get('toastText'), { - duration: 4000 + duration: 4000, + toastClass: this.get('toastClass') }); }, openServiceActionToast() { this.get('paperToaster').show(this.get('toastText'), { duration: 4000, + toastClass: this.get('toastClass'), action: { label: 'Undo', accent: true, diff --git a/tests/dummy/app/styles/demo.scss b/tests/dummy/app/styles/demo.scss index 5d60dd65c..fbeea326d 100644 --- a/tests/dummy/app/styles/demo.scss +++ b/tests/dummy/app/styles/demo.scss @@ -1505,4 +1505,14 @@ md-input-container .hint { md-tabs.md-primary { border-radius: 0px; -} \ No newline at end of file +} + +/* toast demo */ +md-toast { + &.md-accent > .md-toast-content { + background: color($accent, '400'); + } + &.md-warn > .md-toast-content { + background: color($warn, '400'); + } +} diff --git a/tests/dummy/app/templates/demo/toast.hbs b/tests/dummy/app/templates/demo/toast.hbs index 286073c59..c0440230a 100644 --- a/tests/dummy/app/templates/demo/toast.hbs +++ b/tests/dummy/app/templates/demo/toast.hbs @@ -110,7 +110,17 @@