Skip to content

Commit

Permalink
fix: Add image hover zoom to featured image in latest posts block
Browse files Browse the repository at this point in the history
Further resolves #340 by adding the image hover on zoom effect in the latest posts block
  • Loading branch information
knice authored Sep 19, 2024
1 parent 179460f commit 70660f5
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/scss/elements/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ a {
scroll-margin-top: 11rem;
}
}

/**
* Linked Images hover, focus, active transition
*/
Expand All @@ -70,10 +71,11 @@ a {
* transition on hover, focus and active
* unless a user "prefers reduced motion."
*/
figure:has(a) {
figure:has(a),
.wp-block-latest-posts__featured-image:has(a) {
a {
overflow: hidden;
display:block;
display: block;

img {
transition: transform 0.3s ease;
Expand All @@ -82,11 +84,10 @@ figure:has(a) {
&:focus,
&:hover,
&:active {

img {
transform: scale(1.15);
@media screen and (prefers-reduced-motion: reduce) {
transform: none;
transform: none;
}
}
}
Expand All @@ -101,12 +102,12 @@ figure:has(a) {
figure[style^="background-image"]:has(a) {
transition: all 0.3s ease;
background-size: 100% !important;
&:focus,
&:hover,
&:active {
background-size:115% !important;
}
&:focus,
&:hover,
&:active {
background-size: 115% !important;
}
}

/**
* Prefers reduced motion media query
Expand All @@ -115,13 +116,14 @@ figure[style^="background-image"]:has(a) {
* needs to be wrapped in the media query
*
*/

@media screen and (prefers-reduced-motion: reduce) {
figure[style^="background-image"]:has(a) {
background-size: 100% !important;
&:focus,
&:hover,
&:active {
background-size:100% !important;
}
&:focus,
&:hover,
&:active {
background-size: 100% !important;
}
}
}

0 comments on commit 70660f5

Please sign in to comment.