There are a couple of styles:
tr:hover { background-color: var(--hover-color); transition: .2s ease; } tr:active { background-color: var(--link-color); transition: .05s ease; } The task is to ensure that after clicking on the line --link-color there is still half a second through the transition-delay: .5s . In this case, you can not allow delays in the usual hover - only from :active to :hover .