home > notebook > F2U >

code snippets

rules

rainbow on hover

i've been thinking about this theme i used to have on tumblr when i was in my teens and it had an option for the links to display the colors of the rainbow on hover. when i check the source code for the rainbow links it turns out that it was some very old JavaScript code doing the changes which makes sense. the tumblr theme released around feb 2015 and CSS animations became widely available around september 2015.

and so i made my own version using CSS animations and this is the result!

instructions

  1. copy-paste either code snippet on a CSS file (or internal style, fuck it bro it's your life)
  2. code snippet for lighter rainbow
    code snippet for darker rainbow
  3. apply the class name to whatever element you want the rainbow effect on hover. TIP: for links you can just do a:hover instead of .[CLASSNAME]:hover for the CSS selector