diff --git a/src/components/notification/notification.scss b/src/components/notification/notification.scss index 68ce6a7f15..11b783fa43 100644 --- a/src/components/notification/notification.scss +++ b/src/components/notification/notification.scss @@ -40,6 +40,11 @@ --sbb-focus-outline-color: var(--sbb-focus-outline-color-default); } +// By default, the open animation is disabled +:host([data-state='opening']:not(.sbb-animate)) { + @include sbb.disable-animation; +} + :host(:is([data-state='opened'], [data-state='opening'])) { --sbb-notification-opacity: 1; --sbb-notification-max-height: calc( diff --git a/src/components/notification/notification.stories.ts b/src/components/notification/notification.stories.ts index 2d45cb10aa..b1b026f6d0 100644 --- a/src/components/notification/notification.stories.ts +++ b/src/components/notification/notification.stories.ts @@ -49,6 +49,7 @@ const appendNotification = (event: Event, args: Args): void => { '--sbb-notification-margin', '0 0 var(--sbb-spacing-fixed-4x) 0', ); + newNotification.setAttribute('class', 'sbb-animate'); newNotification.titleContent = args['title-content']; newNotification.type = args['type']; newNotification.readonly = args['readonly']; diff --git a/src/components/notification/readme.md b/src/components/notification/readme.md index f4a1167002..7a75980e73 100644 --- a/src/components/notification/readme.md +++ b/src/components/notification/readme.md @@ -73,6 +73,8 @@ This ensures that users who rely on screen readers are promptly informed of any ## Animation +By default, the `sbb-notification` does not have an open animation. Add the `.sbb-animate` class to the element to enable it. + Add the `sbb-disable-animation` class to disable animation and transition effects for the element and all its children.