Using CSS Animations as State Machines to Remember Focus and Hover States With CSS Only, by @patrickbrosset:
Patrick - Using CSS animations as state machines to remember focus and hover states with CSS only
I discovered this CSS-only trick to store the past <code>:focus</code> or <code>:hover</code> state of any element. Without JavaScript, you can style elements depending on whether they were ever focused or hovered. Here's how it works.


