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
+4
View File
@@ -3,6 +3,10 @@
// Anchor absolutes to the outermost part of the card.
position: relative;
// Different browsers use different colors as their fullscreen background,
// this ensures the same experience across all browsers.
background-color: var(--card-background-color);
}
:host([dark]) {
+5 -8
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