Skip to content

Commit

Permalink
feat(notification): disable open animation by default
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga committed Mar 27, 2024
1 parent 73854b3 commit c98de56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/notification/notification.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions src/components/notification/notification.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
2 changes: 2 additions & 0 deletions src/components/notification/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!-- Auto Generated Below -->
Expand Down

0 comments on commit c98de56

Please sign in to comment.