From 298d8de723563bb91702a02fddacfcb6d9523caf Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 5 Aug 2022 05:07:04 -0700 Subject: [PATCH] fix(notification): avoid dynamic class strings Fixes https://github.com/carbon-design-system/carbon-preprocess-svelte/issues/39 --- src/Notification/NotificationButton.svelte | 4 +++- src/Notification/NotificationIcon.svelte | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Notification/NotificationButton.svelte b/src/Notification/NotificationButton.svelte index 63e1d3b9..b25647b7 100644 --- a/src/Notification/NotificationButton.svelte +++ b/src/Notification/NotificationButton.svelte @@ -40,6 +40,8 @@ this="{icon}" size="{20}" title="{title}" - class="bx--{notificationType}-notification__close-icon" + class="{notificationType === 'toast' && + 'bx--toast-notification__close-icon'} {notificationType === 'inline' && + 'bx--inline-notification__close-icon'}" /> diff --git a/src/Notification/NotificationIcon.svelte b/src/Notification/NotificationIcon.svelte index 8e2d61b6..dc6defa8 100644 --- a/src/Notification/NotificationIcon.svelte +++ b/src/Notification/NotificationIcon.svelte @@ -35,5 +35,7 @@ this="{icons[kind]}" size="{20}" title="{iconDescription}" - class="bx--{notificationType}-notification__icon" + class="{notificationType === 'toast' && + 'bx--toast-notification__icon'} {notificationType === 'inline' && + 'bx--inline-notification__icon'}" />