5 An alert that pins to the corner of the screen when triggered by JavaScript. It can be set to disappear after a certain period of time, or to stay put until the user clicks on it. A custom action can be asigned to a notification as well.
\r
7 Optionally, the notifications directive can also tap into the browser's native notification support, if it exists.
\r
10 /// @Foundation.settings
\r
12 $notification-default-position: right top !default;
\r
13 $notification-width: rem-calc(400) !default;
\r
14 $notification-offset: $global-padding !default;
\r
16 $notification-background: $primary-color !default;
\r
17 $notification-color: white !default;
\r
18 $notification-padding: $global-padding !default;
\r
19 $notification-radius: 4px !default;
\r
21 $notification-icon-size: 60px !default;
\r
22 $notification-icon-margin: $global-padding !default;
\r
23 $notification-icon-align: top !default;
\r
32 margin-bottom: .5rem;
\r
43 // Placeholder animation
\r
44 // transition: opacity 1s ease-out;
\r
55 %notification-container {
\r
60 flex-direction: column;
\r
63 @mixin notification-layout(
\r
64 $x: nth($notification-default-position, 1),
\r
65 $y: nth($notification-default-position, 2),
\r
66 $size: $notification-width,
\r
67 $offset: $notification-offset
\r
74 @else if $x == left {
\r
77 @else if $x == middle {
\r
79 margin-left: -($size / 2);
\r
85 @else if $y == bottom {
\r
90 // On small screens, notifications are full width but maintain their vertical orientation
\r
91 @include breakpoint(small only) {
\r
98 @mixin notification-style(
\r
99 $background: $notification-background,
\r
100 $color: $notification-color,
\r
101 $padding: $notification-padding,
\r
102 $radius: $notification-radius
\r
104 background: $background;
\r
106 border-radius: $radius;
\r
108 &, h1, h2, h3, h4, h5, h6 {
\r
113 @mixin notification(
\r
114 $background: $notification-background,
\r
115 $color: $notification-color,
\r
116 $padding: $notification-padding,
\r
117 $radius: $notification-radius
\r
119 @extend %notification;
\r
120 @include notification-style($background, $color, $padding, $radius);
\r
123 @mixin notification-container(
\r
124 $x: nth($notification-default-position, 1),
\r
125 $y: nth($notification-default-position, 2),
\r
126 $size: $notification-width,
\r
127 $offset: $notification-offset
\r
129 @extend %notification-container;
\r
130 @include notification-layout($x, $y, $size, $offset);
\r
133 @mixin notification-icon(
\r
134 $size: $notification-icon-size,
\r
135 $margin: $notification-icon-margin,
\r
136 $align: $notification-icon-align
\r
144 margin-right: $global-padding;
\r
145 align-self: map-get($alignments, $align);
\r
157 @include exports(notification) {
\r
159 @include notification;
\r
161 &.success { @include notification-style($success-color) }
\r
162 &.warning { @include notification-style($warning-color) }
\r
163 &.alert { @include notification-style($alert-color) }
\r
164 &.dark { @include notification-style($dark-color, #fff) }
\r
169 .static-notification {
\r
170 @include notification;
\r
172 position: fixed !important;
\r
174 &.top-right { @include notification-layout(right, top); }
\r
175 &.top-left { @include notification-layout(left, top); }
\r
176 &.top-middle { @include notification-layout(middle, top); }
\r
178 &.bottom-right { @include notification-layout(right, bottom); }
\r
179 &.bottom-left { @include notification-layout(left, bottom); }
\r
180 &.bottom-middle { @include notification-layout(middle, bottom); }
\r
182 &.success { @include notification-style($success-color) }
\r
183 &.warning { @include notification-style($warning-color) }
\r
184 &.alert { @include notification-style($alert-color) }
\r
185 &.dark { @include notification-style($dark-color, #fff) }
\r
188 .notification-container {
\r
189 @include notification-container;
\r
191 &.top-right { @include notification-layout(right, top); }
\r
192 &.top-left { @include notification-layout(left, top); }
\r
193 &.top-middle { @include notification-layout(middle, top); }
\r
195 &.bottom-right { @include notification-layout(right, bottom); }
\r
196 &.bottom-left { @include notification-layout(left, bottom); }
\r
197 &.bottom-middle { @include notification-layout(middle, bottom); }
\r
200 .notification-icon {
\r
201 @include notification-icon;
\r
203 .notification-content {
\r