Function Lab (Chrome only)

Demos of CSS custom functions, using the new @function rule. They only work in Chrome and Edge 139 or later, and none of them use JavaScript.

This page needs CSS @function. Only Chrome and Edge 139 and later have it for now, so it won't work in this browser.

Practical

04 Data Table from Attributes Bars, arrows and heat map colours read from each cell's data-value. 05 Calendar from a Year and Month Weekday of the 1st, month length, leap years, events and today, all worked out in CSS. 06 Crop Around a Focal Point Keeps the subject of a photo in view whatever shape the box is. 07 Recipe Scaler Change servings and units. Amounts round to cups and spoons and show as fractions.

Experiments

01 Sundial for Any Latitude Hour lines and shadow from one function. Change the latitude and the dial changes with it. 02 Spring Bounce Recorder A weight bounces and draws its movement on a drum. One spring function drives both. 03 Gear Train Swap the middle gear. The others re-mesh and the last gear keeps its speed.