DEV Community

Discussion on: Amazing CSS Tips & Tricks - Part 2

Collapse
 
jamesthomson profile image
James Thomson

This last one would be better written with the transition in the h2 so you get the same effect on transition out.

.entry h2 {
  transition: color 0.3s ease; // Also, it's best to only target the property you intend to transition
}

.entry h2:hover{
    color:#f00;
}
Enter fullscreen mode Exit fullscreen mode

+1 for the reminder of clamp, I need to use this more often now that it's far more widely supported.

Collapse
 
tarandeep_singh profile image
Tarandeep Singh • Edited

That's a really nice advice James! Thank you ✨ I'll improve that part, so that all the readers get the best version!