This is a searchable reference for CSS functions — the parenthesised keywords that compute a value rather than naming a fixed one. It covers the math family (calc(), clamp(), min(), max(), trig and exponential functions), value references (var(), env(), attr()), color functions (rgb(), oklch(), color-mix()), gradients, transforms, grid track functions and easing curves.
How it works
A CSS function is a keyword immediately followed by parentheses containing comma-separated arguments. The engine evaluates the function at computed-value time and substitutes the result wherever the function appears. Functions are typed: calc() and the math functions return a length, number, angle or time depending on their inputs; rgb() and friends return a color; linear-gradient() returns an image; the translate()/scale() family returns a transform. Many functions nest — you can wrap a var() inside a clamp() inside a calc() — as long as the units stay compatible within each arithmetic expression. The newer math functions (round(), mod(), sin(), pow(), hypot()) let you do real trigonometry and rounding directly in the stylesheet.
Tips and gotchas
clamp(min, preferred, max) is the workhorse for responsive sizing; pair a rem floor and ceiling with a vw-based preferred value for fluid type. color-mix() reads best in a perceptual space such as oklch or oklab. var() takes an optional fallback as its second argument, used only when the property is genuinely unset. Watch division and multiplication in calc(): you may only divide by a plain number, and at least one operand of a multiplication must be unitless.
Example
:root { --gap: 1rem; }
.title {
font-size: clamp(1.5rem, calc(1rem + 3vw), 3rem);
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
gap: var(--gap, 1rem);
}
.tint { background: color-mix(in oklch, royalblue 70%, white); }
Everything runs in your browser; nothing you search is uploaded.