Skip to content

Commit

Permalink
Create Sibling Fade
Browse files Browse the repository at this point in the history
  • Loading branch information
randybaum authored Dec 6, 2024
0 parents commit 48f5ba7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sibling Fade
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.element {
transition: opacity 0.3s;
}

/* Using the :hover and :not() pseudo-class selectors */
.container:hover .element:not(:hover) {
opacity: 0.5;
}

/* Or using the :has() pseudo-class */
.container:has(.element:hover) .element:not(:hover) {
opacity: 0.5;
}

0 comments on commit 48f5ba7

Please sign in to comment.