-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract message styles into reusable CSS literal (#8242)
- Loading branch information
1 parent
0430bb1
commit c63be0f
Showing
3 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd.. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/ | ||
import type { CSSResult } from 'lit'; | ||
|
||
export const messageStyles: CSSResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2021 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/ | ||
import { css } from 'lit'; | ||
|
||
export const messageStyles = css` | ||
:host { | ||
display: flex; | ||
flex-direction: row; | ||
outline: none; | ||
} | ||
:host([hidden]) { | ||
display: none !important; | ||
} | ||
[part='content'] { | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
} | ||
[part='header'] { | ||
align-items: baseline; | ||
display: flex; | ||
flex-flow: row wrap; | ||
} | ||
[part='name'] { | ||
font-weight: 500; | ||
} | ||
[part='message'] { | ||
white-space: pre-wrap; | ||
} | ||
::slotted([slot='avatar']) { | ||
--vaadin-avatar-outline-width: 0; | ||
flex-shrink: 0; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters