Experiments with CSS ran​dom()

Your browser doesn't support CSS's ran​dom() function, so this page won't really work for you. Sorry!

Contrasting colour pairs

Each li gets an element-scoped ran​dom background colour with a <dashed-indent> name. The same <dashed-indent> name is used to generate the text colour, which then gets hue-rotated between 170°-190° from the background colour to ensure good contrast despite both colours being ran​dom!

List ordering

Here are ten blog posts I've written about CSS, in a ran​dom order:

  1. Queerly Seychellized
  2. Dynamic Sorting in Pure CSS
  3. Styling :visited links using hue- rotation
  4. Preventing eager-loading popovers impacting LCP
  5. Recreating a 1990 Book Cover (in HTML + CSS)
  6. Setting the width of selects to the width of the selected option
  7. For anyone who :has :not yet seen the magic of modern CSS
  8. CSS Lightbox with Alt Text Viewer
  9. Dynamic Filters in Pure CSS
  10. CSS Cycling Gradient Text

This is probably annoying for keyboard users, because CSS-shuffling the order of interactive elements like li​nks doesn't change their tabindex: try "tabbing through" the li​nks and you'll see the selection outline jump up and down all over the place!

Staggered animations

These words appear one at a time in a ran​dom order thanks to CSS randomised "offsetting" as a mechanism for staggering animations.

Flip the switch to watch the words appear!

Edit this page! InfoDead