Skip to content

Commit 1871d28

Browse files
authored
feat(toast): new centered variant to display in the middle of the screen
This PR adds a new centered variant to the toast position to be able to display them in the middle of the screen $('body').toast({ message: 'I am so centered', position: 'centered' })
1 parent d77cc99 commit 1871d28

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/definitions/modules/toast.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@
103103
bottom: @toastContainerDistance;
104104
}
105105
}
106+
&.centered when (@variationToastCentered) {
107+
transform: translate(-50%, -50%);
108+
top: 50%;
109+
left: 50%;
110+
}
106111
& .visible.toast-box,
107112
.animating.toast-box,
108113
.toast-box {

src/themes/default/globals/variation.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@
538538
@variationToastLeft: true;
539539
@variationToastRight: true;
540540
@variationToastCenter: true;
541+
@variationToastCentered: true;
541542
@variationToastInfo: true;
542543
@variationToastWarning: true;
543544
@variationToastSuccess: true;

0 commit comments

Comments
 (0)