Functions are a type of CSS value inserted in place of a hardcoded value on a property. Interact with the sliders below to see each function in action.
Sizing & Math
calc()
Performs math operations — mix units freely, like % with px.
off40px
calc(100% − 40px)
min()
Returns the smallest of its arguments — useful for responsive caps.
%60%
min(60%, 300px)
max()
Returns the largest of its arguments — great for minimum sizes.
%30%
max(30%, 120px)
clamp()
Keeps a value between a min and max, scaling fluidly in between.
vw400
clamp(1rem, 4vw, 3rem)
Sample text scales here
Color
rgb() / rgba()
Sets color by red, green, blue channels. rgba() adds alpha transparency.
R99
G60
B220
A1
rgba(99, 60, 220, 1)
hsl() / hsla()
Sets color by hue, saturation, lightness — intuitive for designing palettes.