Fix thumbnail proportions in Safari

This commit is contained in:
Dermot Duffy
2022-06-26 16:44:39 -07:00
parent f641e4c444
commit 2a33316e62
2 changed files with 10 additions and 9 deletions
+6 -9
View File
@@ -1,18 +1,15 @@
:host {
display: block;
max-width: var(--frigate-card-thumbnail-size);
max-height: var(--frigate-card-thumbnail-size);
overflow: hidden;
// Restrict images to a maximum of thumbnail size.
aspect-ratio: 1 / 1;
}
img, ha-icon {
img,
ha-icon {
border-radius: var(--ha-card-border-radius, 4px);
width: 100%;
height: 100%;
max-width: var(--frigate-card-thumbnail-size);
max-height: 100%;
aspect-ratio: 1 / 1;
// Not 'contain' as some thumbnails may vary in aspect-ratio slightly and
// should be clipped to fill the thumbnail div whilst maintaining
@@ -26,6 +23,6 @@ ha-icon {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid rgba(255,255,255,0.3);
border: 1px solid rgba(255, 255, 255, 0.3);
box-sizing: border-box;
}