Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -1,56 +1,51 @@
<div class="sample avatar-overview-sample">
<!-- Simple avatar -->
<igx-avatar
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-04.png"
alt="A profile photo of a man.">
</igx-avatar>

<!-- Avatar + badge -->
<igx-avatar
class="profile-status"
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-06.png"
alt="A profile photo of a woman.">
</igx-avatar>
<igx-badge
class="status-badge"
dot
outlined
type="success">
</igx-badge>

<!-- Avatar stack -->
<div class="avatar-stack" aria-label="Project members">
<igx-avatar
class="size-large"
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-04.png"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-07.png"
alt="A profile photo of a animated kid.">
</igx-avatar>
<igx-avatar
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-03.png"
alt="A profile photo of a man.">
</igx-avatar>

<span class="avatar-with-badge">
<igx-avatar
class="size-large"
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-06.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-badge
class="avatar-status size-large"
dot
outlined
type="success">
</igx-badge>
</span>

<span class="avatar-stack" aria-label="Project members">
<igx-avatar
class="size-large"
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-07.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-avatar
class="size-large"
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-03.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-avatar
class="size-large"
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-08.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-avatar
class="size-large"
shape="circle"
size="large"
initials="+3"
alt="Three additional project members.">
</igx-avatar>
</span>
<igx-avatar
shape="circle"
size="large"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-08.png"
alt="A profile photo of a abstract flat cat.">
</igx-avatar>
<igx-avatar
shape="circle"
size="large"
initials="+3"
alt="Three additional project members.">
</igx-avatar>
</div>

Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
.avatar-overview-sample {
@use "igniteui-theming/sass/typography" as *;

:host {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 90px;
width: 100%;
min-height: 100vh;
gap: rem(100px);
height: 100vh;
padding: rem(32px);
}

.avatar-with-badge {
position: relative;
display: inline-flex;
.profile-status {
anchor-name: --profile-status;
}

.avatar-status {
.status-badge {
position: absolute;
right: 6px;
bottom: 6px;
position-anchor: --profile-status;
inset-block-start: anchor(85%);
inset-inline-start: anchor(85%);
translate: -50% -50%;
}

.avatar-stack {
display: inline-flex;
align-items: center;
}

.avatar-stack .size-large {
margin-left: -24px;
}
display: flex;

.avatar-stack .size-large:first-child {
margin-left: 0;
}
igx-avatar {
box-shadow: 0 0 0 rem(6px) var(--ig-surface-500);

.avatar-stack .igx-avatar {
border: 4px solid #fff;
box-sizing: border-box;
}

.avatar-stack .size-large:last-child {
--ig-avatar-background: #e8eef6;
--ig-avatar-color: #6f8097;
}
+ igx-avatar {
margin-inline-start: rem(-24px);
}

.avatar-stack .size-large:last-child .igx-avatar__initials {
font-size: 32px;
font-weight: 500;
&:last-child {
--ig-avatar-background: #e8eef6;
--ig-avatar-color: #6f8097;
}
}
}
94 changes: 40 additions & 54 deletions src/app/layouts/avatar/avatar-shape/avatar-shape.component.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,42 @@
<div class="sample avatar-shape-sample">
<div class="avatar-variant">
<span class="avatar-with-badge">
<igx-avatar
class="size-small"
shape="circle"
size="small"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-06.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-badge
class="avatar-status avatar-dot-badge size-small"
dot
outlined
type="success">
</igx-badge>
</span>
<span class="avatar-label">Circle</span>
</div>
<!-- Avatar Circle -->
<igx-avatar
shape="circle"
size="small"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-06.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-badge
dot
outlined
type="success">
</igx-badge>
<span>Circle</span>

<div class="avatar-variant">
<span class="avatar-with-badge">
<igx-avatar class="size-small" shape="square" size="small">
<igx-icon name="mail" collection="material"></igx-icon>
</igx-avatar>
<igx-badge
class="avatar-status avatar-count-badge size-small"
outlined
shape="square"
type="info">
2
</igx-badge>
</span>
<span class="avatar-label">Square</span>
</div>
<!-- Avatar Square -->
<igx-avatar
shape="square"
size="small">
<igx-icon name="mail" collection="material"></igx-icon>
</igx-avatar>
<igx-badge
outlined
shape="square"
type="info">
2
</igx-badge>
<span>Square</span>

<div class="avatar-variant">
<span class="avatar-with-badge">
<igx-avatar
class="size-small"
shape="rounded"
size="small"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-07.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-badge
class="avatar-status avatar-check-badge size-small"
outlined
shape="rounded"
type="success">
<igx-icon name="check" collection="material"></igx-icon>
</igx-badge>
</span>
<span class="avatar-label">Rounded</span>
</div>
</div>
<!-- Avatar Rounded -->
<igx-avatar
shape="rounded"
size="small"
src="https://dl.infragistics.com/x/img/avatars/avatar-profile-07.png"
alt="A profile photo of a man.">
</igx-avatar>
<igx-badge
outlined
shape="rounded"
type="success">
<igx-icon name="check" collection="material"></igx-icon>
</igx-badge>
<span>Rounded</span>
72 changes: 38 additions & 34 deletions src/app/layouts/avatar/avatar-shape/avatar-shape.component.scss
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
.avatar-shape-sample {
display: flex;
align-items: center;
justify-content: center;
gap: 90px;
min-height: 100vh;
@use "sass:list";
@use "igniteui-theming/sass/typography" as *;

$avatars: circle, square, rounded;

:host {
display: grid;
grid-auto-flow: column;
grid-template-rows: auto auto;
place-content: center;
place-items: center;
column-gap: rem(40px);
row-gap: rem(8px);
height: 100vh;
padding: rem(32px);
}

.avatar-variant {
display: inline-flex;
flex-direction: column;
align-items: center;
gap: 8px;
igx-avatar {
grid-row: 1;
}

.avatar-label {
span {
grid-row: 2;
text-align: center;
color: var(--ig-gray-600);
font-size: 0.875rem;
line-height: 1.25rem;
}

.avatar-with-badge {
position: relative;
display: inline-flex;
@include type-style("body-1") {
margin: 0;
};
}

.avatar-status {
--size: 18px;
igx-badge {
--ig-size: var(--ig-size-small);

position: absolute;
right: -4px;
bottom: -4px;
font-size: 0.75rem;
line-height: 1;
inset-block-start: anchor(85.5%);
inset-inline-start: anchor(85.5%);
translate: -50% -50%;
}

.avatar-dot-badge {
--size: 12px;
right: 3px;
bottom: 3px;
}
// The avatars and badges are flat siblings, so every badge needs its own anchor name to pin to.
@each $avatar in $avatars {
$i: list.index($avatars, $avatar);

.avatar-count-badge {
--ig-badge-text-color: #ffffff;
}
igx-avatar:nth-of-type(#{$i}) {
anchor-name: --#{$avatar};
}

.avatar-check-badge {
--ig-badge-icon-color: #ffffff;
igx-badge:nth-of-type(#{$i}) {
position-anchor: --#{$avatar};
}
}
Loading
Loading