From cfcd7f4eb1730d689b38202885549fcf9608c9a8 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 14 Aug 2022 12:59:07 -0700 Subject: [PATCH] feat(toast-notification): add `fullWidth` prop --- src/Notification/ToastNotification.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Notification/ToastNotification.svelte b/src/Notification/ToastNotification.svelte index 1d00ba4e..0048fd47 100644 --- a/src/Notification/ToastNotification.svelte +++ b/src/Notification/ToastNotification.svelte @@ -33,6 +33,12 @@ /** Set to `true` to hide the close button */ export let hideCloseButton = false; + /** + * Set to `true` for the notification to span + * the full width of its containing element. + */ + export let fullWidth = false; + import { createEventDispatcher, onMount } from "svelte"; import NotificationButton from "./NotificationButton.svelte"; import NotificationIcon from "./NotificationIcon.svelte"; @@ -78,6 +84,7 @@ class:bx--toast-notification--warning="{kind === 'warning'}" class:bx--toast-notification--warning-alt="{kind === 'warning-alt'}" {...$$restProps} + style="{fullWidth && 'width: 100%;'}{$$restProps.style}" on:click on:mouseover on:mouseenter