Skip to content

Commit

Permalink
feat(avatar): added fit modifier (#2565)
Browse files Browse the repository at this point in the history
  • Loading branch information
agliga authored Feb 11, 2025
1 parent 1b316bd commit abcb849
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 157 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-turkeys-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/skin": minor
---

feat(avatar): added custom fit avatar
24 changes: 22 additions & 2 deletions dist/avatar/avatar.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
.avatar {
align-items: center;
background-color: #84b4fb;
border-radius: 50%;
color: #002a69;
display: inline-flex;
font-size: var(--font-size-large-2);
font-weight: var(--font-weight-bold);
height: 48px;
justify-content: center;
line-height: 48px;
overflow: hidden;
position: relative;
width: 48px;
}
.avatar:after {
background: rgba(0, 0, 0, 0.05);
bottom: 0;
content: "";
display: block;
left: 0;
pointer-events: none;
position: absolute;
right: 0;
top: 0;
}
.avatar > img {
display: inline-block;
max-height: 100%;
max-width: 100%;
object-fit: contain;
}

.avatar > svg {
height: 100%;
Expand All @@ -24,6 +40,10 @@
width: 48px;
}

.avatar--fit > img {
object-fit: contain;
}

.avatar--teal {
background-color: #84b4fb;
color: #002a69;
Expand Down
4 changes: 2 additions & 2 deletions dist/mixins/_utility-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
white-space: nowrap;
}

@mixin image-treatment($border-radius: 8px) {
@mixin image-treatment($border-radius: 8px, $display: flex) {
align-items: center;
border-radius: $border-radius;
display: flex;
display: $display;
justify-content: center;
overflow: hidden;
position: relative;
Expand Down
Loading

0 comments on commit abcb849

Please sign in to comment.