Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 8 additions & 58 deletions articles/components/avatar/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -318,83 +318,33 @@ include::{root}/frontend/demo/component/avatar/react/avatar-group-internationali
endif::[]
--

== Size Variants

Avatar has four available size variants:
== Use Cases

Avatar can be paired with Popover to create a user account menu.

[.example]
--

ifdef::lit[]
[source,html]
----
include::{root}/frontend/demo/component/avatar/avatar-sizes.ts[render,tags=snippet,indent=0,group=Lit]
include::{root}/frontend/demo/component/popover/popover-user-menu.ts[render,tags=snippet,indent=0,group=Lit]
----
endif::[]

ifdef::flow[]
[source,java]
----
include::{root}/src/main/java/com/vaadin/demo/component/avatar/AvatarSizes.java[render,tags=snippet,indent=0,group=Flow]
include::{root}/src/main/java/com/vaadin/demo/component/popover/PopoverUserMenu.java[render,tags=snippet,indent=0,group=Flow]
----
endif::[]

ifdef::react[]
[source,tsx]
----
include::{root}/frontend/demo/component/avatar/react/avatar-sizes.tsx[render,tags=snippet,indent=0,group=React]
----
endif::[]
--

|===
| Variant | Theme name

|Extra large
|`xlarge`

|Large
|`large`

|Small
|`small`

|Extra small
|`xsmall`

|===

Size variants should be used only in special cases.
See <<{articles}/styling/lumo/lumo-style-properties/size-space#,Size and Space>> for details on how to
change the default Avatar size.

== Use Cases

Avatar can be paired with Menu Bar to create a user account menu.

[.example]
--

ifdef::lit[]
[source,javascript]
----
include::{root}/frontend/demo/component/avatar/avatar-menu-bar.ts[render,tags=snippet,indent=0,group=Lit]
include::{root}/frontend/demo/component/popover/react/popover-user-menu.tsx[render,tags=snippet,indent=0,group=React]
----
endif::[]

ifdef::flow[]
[source,java]
[source,css]
----
include::{root}/src/main/java/com/vaadin/demo/component/avatar/AvatarMenuBar.java[render,tags=snippet,indent=0,group=Flow]
include::{root}/frontend/themes/docs/popover-user-menu.css[]
----
endif::[]

ifdef::react[]
[source,tsx]
----
include::{root}/frontend/demo/component/avatar/react/avatar-menu-bar.tsx[render,tags=snippet,indent=0,group=React]
----
endif::[]
--


Expand Down
54 changes: 49 additions & 5 deletions articles/components/avatar/styling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,69 @@ order: 50
---
= Avatar Styling


== Style Variants

Avatar and Avatar Group support the following style variants:

[cols="1,3,1"]
|===
| Variant | Description | Supported by

|`reverse`
|Reverses the stacking order of avatars in Avatar Group
|Aura, Lumo

|`large`
|Large avatar size
|Lumo

|`small`
|Small avatar size
|Lumo

|`xlarge`
|Extra large avatar size
|Lumo

|`xsmall`
|Extra small avatar size
|Lumo

|===


include::../_styling-section-theming-props.adoc[tag=style-properties]

=== Common Properties

[cols="1,2,2"]
|===
| Feature | Property | Default Value
| Feature | Property | Supported by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --vaadin-avatar-group-gap custom CSS property is missing (also supported by Lumo).


|Avatar size
|`--vaadin-avatar-size`
|`var(--lumo-size-m)`
|Aura, Lumo

|Avatar background
|`--vaadin-avatar-background`
|Aura, Lumo

|Avatar border width
|`--vaadin-avatar-border-width`
|Aura

|Avatar border color
|`--vaadin-avatar-border-color`
|Aura

|Avatar Group overlap
|`--vaadin-avatar-group-overlap`
|`8px`
|Aura, Lumo

|Avatar Group overlap border
|Avatar Group overlap border width
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is marked as deprecated in the source CSS, should we maybe remove it from here?

|`--vaadin-avatar-group-overlap-border`
|`2px`
|Lumo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove or change "User Color Properties" below as that table lists Lumo default values?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the list but remove the default values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Also, in Lumo we only have 7 colors (0-6) but in base styles we have 10 (0-9).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't realize that. Perhaps we should add 3 more to Lumo.


|===

Expand Down
61 changes: 0 additions & 61 deletions frontend/demo/component/avatar/avatar-menu-bar.ts

This file was deleted.

53 changes: 0 additions & 53 deletions frontend/demo/component/avatar/avatar-sizes.ts

This file was deleted.

49 changes: 0 additions & 49 deletions frontend/demo/component/avatar/react/avatar-menu-bar.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions frontend/demo/component/avatar/react/avatar-sizes.tsx

This file was deleted.

Loading
Loading