mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
Add rounded variation
This commit is contained in:
4
src/components.d.ts
vendored
4
src/components.d.ts
vendored
@@ -44,7 +44,7 @@ export namespace Components {
|
||||
/**
|
||||
* Initials to use as a fallback when no image is available (1-2 characters max recommended).
|
||||
*/
|
||||
"shape": 'circle' | 'square';
|
||||
"shape": 'circle' | 'square' | 'rounded';
|
||||
}
|
||||
interface SlBadge {
|
||||
/**
|
||||
@@ -1086,7 +1086,7 @@ declare namespace LocalJSX {
|
||||
/**
|
||||
* Initials to use as a fallback when no image is available (1-2 characters max recommended).
|
||||
*/
|
||||
"shape"?: 'circle' | 'square';
|
||||
"shape"?: 'circle' | 'square' | 'rounded';
|
||||
}
|
||||
interface SlBadge {
|
||||
/**
|
||||
|
||||
@@ -31,10 +31,14 @@
|
||||
border-radius: var(--sl-border-radius-circle);
|
||||
}
|
||||
|
||||
.avatar--square {
|
||||
.avatar--rounded {
|
||||
border-radius: var(--sl-border-radius-medium);
|
||||
}
|
||||
|
||||
.avatar--square {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.avatar__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -29,7 +29,7 @@ export class Avatar {
|
||||
@Prop() initials = '';
|
||||
|
||||
/** Initials to use as a fallback when no image is available (1-2 characters max recommended). */
|
||||
@Prop() shape: 'circle' | 'square' = 'circle';
|
||||
@Prop() shape: 'circle' | 'square' | 'rounded' = 'circle';
|
||||
|
||||
handleImageError() {
|
||||
this.hasError = true;
|
||||
@@ -43,6 +43,7 @@ export class Avatar {
|
||||
class={{
|
||||
avatar: true,
|
||||
'avatar--circle': this.shape === 'circle',
|
||||
'avatar--rounded': this.shape === 'rounded',
|
||||
'avatar--square': this.shape === 'square'
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user