Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
fix: icon aspect ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
Messias Junior committed May 10, 2021
1 parent 1cdee81 commit b397c41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/ui/components/card/card.component.html
Expand Up @@ -5,7 +5,7 @@
[title]="application?.packageType"
alt="{{ application?.packageType }} icon"
/>
<nb-card>
<nb-card class="img-wrapper">
<img
[src]="application?.icon || 'assets/icon/icon-placeholder.png'"
alt="{{ application?.name }} icon"
Expand Down
25 changes: 16 additions & 9 deletions src/app/ui/components/card/card.component.scss
@@ -1,9 +1,24 @@
img {
.img-wrapper {
padding-bottom: 100%;
position: relative;
}

.img-wrapper img {
position: absolute;
padding: 1rem;
width: 100%;
height: auto;
}

.badge {
position: absolute;
height: 2rem;
width: 2rem;
margin-top: -0.5rem;
margin-left: -0.5rem;
z-index: 1;
}

nb-card {
margin-bottom: 0;
}
Expand All @@ -29,11 +44,3 @@ h6 {
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

.badge {
position: absolute;
height: 3.6rem;
width: 3.6rem;
margin-top: -0.5rem;
margin-left: -0.5rem;
}

0 comments on commit b397c41

Please sign in to comment.