Opacity Transitions
Transitioning opacity is the standard way to fade elements in and out. Combined with pointer-events, it can create accessible show/hide patterns.
Transitioning opacity is the standard way to fade elements in and out. Combined with pointer-events, it can create accessible show/hide patterns.
.tooltip {
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease;
}
.trigger:hover .tooltip,
.trigger:focus .tooltip {
opacity: 1;
pointer-events: auto;
}
/* Fade in on load */
.fade-in {
animation: none;
opacity: 0;
transition: opacity 0.5s ease 0.1s;
}
.fade-in.visible { opacity: 1; }
Use opacity + pointer-events instead of display:none/block when you want to transition visibility.