Skip to content

Instantly share code, notes, and snippets.

@cyancey76
Last active April 26, 2019 21:25
Show Gist options
  • Select an option

  • Save cyancey76/198579017067e4b5c7dce2e52e185cb8 to your computer and use it in GitHub Desktop.

Select an option

Save cyancey76/198579017067e4b5c7dce2e52e185cb8 to your computer and use it in GitHub Desktop.
CSS fade out sibling elements
.parent-element {
pointer-events: none;
}
.parent-element > * {
pointer-events: auto;
transition: 300ms opacity, 300ms transform;
}
.parent-element:hover > .sibling-elements,
.parent-element:focus-within > .sibling-elements {
opacity: 0.25;
}
.parent-element:hover > .sibling-elements:hover,
.parent-element:focus-within > :focus {
opacity: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment