Skip to content

Commit cd799f6

Browse files
authored
docs: simplify vaadin-message JSDoc, fix example formatting (#11395)
1 parent f55125c commit cd799f6

File tree

4 files changed

+16
-38
lines changed

4 files changed

+16
-38
lines changed

packages/message-list/src/vaadin-message-mixin.d.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,7 @@ export declare class MessageMixinClass {
5656

5757
/**
5858
* A color index to be used to render the color of the avatar.
59-
* With no `userColorIndex` set, the basic avatar color will be used.
60-
* By setting a userColorIndex, the component will check if there exists a CSS variable defining the color, and uses it if there is one.
61-
* If now CSS variable is found for the color index, the property for the color will not be set.
6259
*
63-
* Example:
64-
* CSS:
65-
* ```css
66-
* html {
67-
* --vaadin-user-color-1: red;
68-
* }
69-
* ```
70-
*
71-
* JavaScript:
72-
* ```js
73-
* message.userColorIndex = 1;
74-
* ```
7560
* @attr {number} user-color-index
7661
*/
7762
userColorIndex: number | null | undefined;

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,7 @@ export const MessageMixin = (superClass) =>
5858

5959
/**
6060
* A color index to be used to render the color of the avatar.
61-
* With no `userColorIndex` set, the basic avatar color will be used.
62-
* By setting a userColorIndex, the component will check if there exists a CSS variable defining the color, and uses it if there is one.
63-
* If now CSS variable is found for the color index, the property for the color will not be set.
6461
*
65-
* Example:
66-
* CSS:
67-
* ```css
68-
* html {
69-
* --vaadin-user-color-1: red;
70-
* }
71-
* ```
72-
*
73-
* JavaScript:
74-
* ```js
75-
* message.userColorIndex = 1;
76-
* ```
7762
* @attr {number} user-color-index
7863
*/
7964
userColorIndex: {

packages/message-list/src/vaadin-message.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ export type MessageEventMap = HTMLElementEventMap & {
1717
* `<vaadin-message>` is a Web Component for showing a single message with an author, message and time.
1818
*
1919
* ```html
20-
* <vaadin-message time="2021-01-28 10:43"
21-
* user-name = "Bob Ross"
22-
* user-abbr = "BR"
23-
* user-img = "/static/img/avatar.jpg">There is no real ending. It's just the place where you stop the story.</vaadin-message>
20+
* <vaadin-message
21+
* time="2021-01-28 10:43"
22+
* user-name="Bob Ross"
23+
* user-abbr="BR"
24+
* user-img="/static/img/avatar.jpg"
25+
* >
26+
* There is no real ending. It's just the place where you stop the story.
27+
* </vaadin-message>
2428
* ```
2529
*
2630
* ### Styling

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ import { MessageMixin } from './vaadin-message-mixin.js';
1717
* `<vaadin-message>` is a Web Component for showing a single message with an author, message and time.
1818
*
1919
* ```html
20-
* <vaadin-message time="2021-01-28 10:43"
21-
* user-name = "Bob Ross"
22-
* user-abbr = "BR"
23-
* user-img = "/static/img/avatar.jpg">There is no real ending. It's just the place where you stop the story.</vaadin-message>
20+
* <vaadin-message
21+
* time="2021-01-28 10:43"
22+
* user-name="Bob Ross"
23+
* user-abbr="BR"
24+
* user-img="/static/img/avatar.jpg"
25+
* >
26+
* There is no real ending. It's just the place where you stop the story.
27+
* </vaadin-message>
2428
* ```
2529
*
2630
* ### Styling

0 commit comments

Comments
 (0)