Skip to content

Commit d5579d6

Browse files
authored
refactor: update message to use base styles, cleanup Lumo CSS (#10061)
1 parent 3444d31 commit d5579d6

File tree

2 files changed

+13
-32
lines changed

2 files changed

+13
-32
lines changed

packages/message-list/src/vaadin-message.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ class Message extends MessageMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoI
5757
return messageStyles;
5858
}
5959

60+
static get lumoInjector() {
61+
return {
62+
includeBaseStyles: true,
63+
};
64+
}
65+
6066
/** @protected */
6167
render() {
6268
return html`

packages/vaadin-lumo-styles/src/components/message.css

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,38 @@
55
*/
66
@media lumo_components_message {
77
:host {
8-
display: flex;
9-
flex-direction: row;
10-
outline: none;
118
color: var(--lumo-body-text-color);
129
font-family: var(--lumo-font-family);
1310
font-size: var(--lumo-font-size-m);
1411
line-height: var(--lumo-line-height-m);
1512
padding: var(--lumo-space-s) var(--lumo-space-m);
13+
gap: 0;
1614
-moz-osx-font-smoothing: grayscale;
1715
-webkit-font-smoothing: antialiased;
1816
-webkit-text-size-adjust: 100%;
1917
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
2018
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
2119
}
2220

23-
:host([hidden]) {
24-
display: none !important;
25-
}
26-
27-
[part='content'] {
28-
display: flex;
29-
flex-direction: column;
30-
flex-grow: 1;
21+
:host(:is(:focus-visible, [focus-ring])) {
22+
outline: none;
3123
}
3224

3325
[part='header'] {
34-
align-items: baseline;
35-
display: flex;
36-
flex-flow: row wrap;
3726
min-height: calc(var(--lumo-font-size-m) * var(--lumo-line-height-m));
3827
}
3928

4029
[part='name'] {
41-
font-weight: 500;
42-
margin-right: var(--lumo-space-s);
30+
color: inherit;
31+
margin-inline-end: var(--lumo-space-s);
4332
}
4433

4534
[part='name']:empty {
46-
margin-right: 0;
35+
margin-inline-end: 0;
4736
}
4837

4938
[part='message'] {
50-
white-space: pre-wrap;
39+
color: inherit;
5140
}
5241

5342
[part='time'] {
@@ -58,25 +47,11 @@
5847
::slotted([slot='avatar']) {
5948
--vaadin-avatar-outline-width: 0;
6049
--vaadin-avatar-size: var(--lumo-size-m);
61-
flex-shrink: 0;
6250
margin-top: calc(var(--lumo-space-s));
6351
margin-inline-end: calc(var(--lumo-space-m));
6452
}
6553

66-
::slotted(vaadin-markdown) {
67-
white-space: normal;
68-
}
69-
7054
:host([focus-ring]) {
7155
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
7256
}
73-
74-
:host([dir='rtl']) [part='name'] {
75-
margin-left: var(--lumo-space-s);
76-
margin-right: 0;
77-
}
78-
79-
:host([dir='rtl']) [part='name']:empty {
80-
margin-left: 0;
81-
}
8257
}

0 commit comments

Comments
 (0)