Skip to content

Commit 9aadfaf

Browse files
committed
adjust toast notification to look more proper as a one liner
1 parent 66ee274 commit 9aadfaf

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

packages/uui-toast-notification-layout/lib/uui-toast-notification-layout.element.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ export class UUIToastNotificationLayoutElement extends LitElement {
1515
static styles = [
1616
UUITextStyles,
1717
css`
18-
#message > h5 {
18+
#message {
19+
margin-bottom: calc(var(--uui-size-space-1) * -1);
20+
}
21+
#message::after {
22+
content: '';
23+
display: block;
24+
clear: both;
1925
}
2026
#actions {
2127
/*
@@ -26,15 +32,9 @@ export class UUIToastNotificationLayoutElement extends LitElement {
2632
display: block;
2733
float: right;
2834
29-
margin-top: var(--uui-size-space-3);
35+
margin-top: var(--uui-size-space-4);
3036
margin-bottom: calc(var(--uui-size-space-2) * -1);
3137
}
32-
33-
#message::after {
34-
content: '';
35-
display: block;
36-
clear: both;
37-
}
3838
`,
3939
];
4040

@@ -59,7 +59,8 @@ export class UUIToastNotificationLayoutElement extends LitElement {
5959
return html`
6060
<div id="message" class="uui-text">
6161
<h5
62-
style=${this._headlineSlotHasContent || this.headline !== null
62+
style=${this._headlineSlotHasContent ||
63+
(this.headline && this.headline !== '')
6364
? ''
6465
: 'display: none'}>
6566
${this.headline}

packages/uui-toast-notification/lib/uui-toast-notification.element.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ export class UUIToastNotificationElement extends LitElement {
8484
8585
#close {
8686
float: right;
87-
margin-top: -7px;
87+
margin-top: -6px;
8888
margin-left: var(--uui-size-space-1);
89-
margin-bottom: calc(var(--uui-size-space-2) * -1);
90-
margin-bottom: var(--uui-size-space-1);
89+
margin-bottom: -4px;
9190
}
9291
9392
#close > uui-button {

packages/uui-toast-notification/lib/uui-toast-notification.story.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ AAAOverview.parameters = {
4242
export const ErrorStyle: Story = props => html`<uui-toast-notification
4343
.open=${props.open}
4444
.look=${props.look}>
45-
<uui-toast-notification-layout headline="Document could not be published!">
46-
An error occurred while attempting to contact the server. Please check your
47-
internet connection.
45+
<uui-toast-notification-layout .headline=${props.headline}>
46+
${props.message}
4847
<uui-button slot="actions" look="danger">Retry</uui-button>
4948
</uui-toast-notification-layout>
5049
</uui-toast-notification>`;
5150
ErrorStyle.args = {
5251
headline: 'Document could not be published!',
52+
message:
53+
'An error occurred while attempting to contact the server. Please check your internet connection.',
5354
look: 'danger',
5455
};
5556
ErrorStyle.parameters = {
@@ -70,12 +71,13 @@ export const PositiveStyle: Story = props => html`<uui-toast-notification
7071
.open=${props.open}
7172
.look=${props.look}>
7273
<uui-toast-notification-layout .headline=${props.headline}>
73-
<p>This document is now saved and published.</p>
74+
${props.message}
7475
<uui-button slot="actions" .look=${props.look}>View in browser</uui-button>
7576
</uui-toast-notification-layout>
7677
</uui-toast-notification>`;
7778
PositiveStyle.args = {
7879
headline: 'Document was published',
80+
message: 'This document is now saved and published.',
7981
look: 'positive',
8082
};
8183
PositiveStyle.parameters = {

0 commit comments

Comments
 (0)