Get the latest tech news

Rolling the dice with CSS random()


Random functions in programming languages are amazing.

It’s important to realize that setting a custom property to a CSS function isn’t like other programming languages where a variable stores a result. The first drop shadow also uses random() to select a hue with oklch() to add vibrant colors that are composited over a soft white glow with a hard-light blend mode. However, it’s important to note that there are ongoing discussions in the CSS Working Group about the specification, and several open issues remain about whether this approach best serves developers’ needs.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of css

css

Photo of Dice

Dice

Related news:

News photo

The attr() function in CSS now supports types

News photo

Creating 3D Worlds with HTML and CSS (2013)

News photo

Dice announces Battlefield 6 Open Beta Week 2 playlist options and changes