mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
add custom properties to avatar
This commit is contained in:
@@ -2,9 +2,11 @@ import { css } from 'lit';
|
||||
|
||||
export default css`
|
||||
:host {
|
||||
display: inline-block;
|
||||
|
||||
--background: var(--wa-color-neutral-fill-highlight);
|
||||
--content-color: var(--wa-color-neutral-text-on-fill);
|
||||
--size: 3rem;
|
||||
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
@@ -14,10 +16,10 @@ export default css`
|
||||
position: relative;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
background-color: var(--wa-color-neutral-spot);
|
||||
background: var(--background);
|
||||
font: inherit;
|
||||
font-size: calc(var(--size) * 0.5);
|
||||
color: var(--wa-color-neutral-text-on-spot);
|
||||
font-size: calc(var(--size) * 0.4);
|
||||
color: var(--content-color);
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
vertical-align: middle;
|
||||
|
||||
@@ -23,6 +23,8 @@ import type { CSSResultGroup } from 'lit';
|
||||
* @csspart initials - The container that wraps the avatar's initials.
|
||||
* @csspart image - The avatar image. Only shown when the `image` attribute is set.
|
||||
*
|
||||
* @cssproperty --background - The avatar's background styles.
|
||||
* @cssproperty --content-color - The color of the avatar's content.
|
||||
* @cssproperty --size - The size of the avatar.
|
||||
*/
|
||||
@customElement('wa-avatar')
|
||||
|
||||
Reference in New Issue
Block a user