Force 3/2 format for non landscape photos on Location page
Center image on a background when square, portrait or other ratio - Fix MutuationObserver for using components (would think a component is an item)
This commit is contained in:
@@ -81,7 +81,6 @@
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
border-radius: 0;
|
||||
background: $color-primary;
|
||||
|
||||
@include bp (sm) {
|
||||
border-radius: 8px;
|
||||
@@ -97,6 +96,38 @@
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
// Variant: Not landscape
|
||||
&.not-landscape {
|
||||
aspect-ratio: 3 / 2;
|
||||
|
||||
@supports not (aspect-ratio: auto) {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding-top: 66.66%;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
picture {
|
||||
height: 100%;
|
||||
background: $color-cream;
|
||||
}
|
||||
img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
|
||||
@supports not (aspect-ratio: auto) {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Scale down image on hover
|
||||
@media (hover: hover) {
|
||||
a:hover {
|
||||
|
||||
Reference in New Issue
Block a user