Skip to content

Commit

Permalink
fix: margin transition
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Jan 3, 2024
1 parent 91ac9d2 commit af0907b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/notification/notification.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// to default color for cases where the notification is used in a negative context.
--sbb-focus-outline-color: var(--sbb-focus-outline-color-default);

margin: 0;
margin: var(--sbb-notification-margin);
transition: margin var(--sbb-notification-animation-duration)
var(--sbb-notification-timing-function);
animation: {
Expand All @@ -61,8 +61,6 @@
var(--sbb-notification-timing-function),
opacity var(--sbb-notification-animation-duration) var(--sbb-notification-animation-duration)
var(--sbb-notification-timing-function);

margin: var(--sbb-notification-margin);
}

:host(:is([data-resize-disable-animation], [disable-animation])) {
Expand Down
1 change: 1 addition & 0 deletions src/components/notification/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class SbbNotificationElement extends LitElement {
public close(): void {
if (this._state === 'opened') {
this._state = 'closing';
this.style.setProperty('--sbb-notification-margin', '0');
this._willClose.emit();
this.disableAnimation && this._handleClosing();
}
Expand Down

0 comments on commit af0907b

Please sign in to comment.