Functions in CSS?!

March 5, 2025

What exactly is a function in CSS?

I like this definition from the spec:

Custom functions allow authors the same power as custom properties, but parameterized

They are used in the same places you would use a custom property, but functions return different things depending on the argument we pass. The syntax for the most basic function is the @function at-rule, followed by the name of the function as a + ()

Source: Functions in CSS?! | CSS-Tricks

As we’ve observed before we generally focus on things that are broadly possible now at Conffab, but some things are potentially so impactful that we like to get out in front of them even if they’re not quote ready for primetime.

CSS functions are one such thing–and they are even available behind flags in Chrome to experiment with.

Learn more with Juan Diego Rodríguez at CSS Tricks.