Skip to main content

Functional Notations

@see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions

// Examples
width: 'calc(100% - 100px)',
fontSize: 'clamp(1rem, 2.5vw, 2rem)',
height: 'max(20vw, calc(90% - 400px))',

Math functions#

calc()#

The calc() function lets you perform calculations when specifying property values.

clamp()#

The clamp() function clamps a value between an upper and lower bound. clamp() enables selecting a middle value within a range of values between a defined minimum and maximum. It takes three parameters: a minimum value, a preferred value, and a maximum allowed value.

min()#

The min() function lets you set the smallest (most negative) value from a list of comma-separated expressions as the value of a property value.

max()#

The max() function lets you set the largest (most positive) value from a list of comma-separated expressions as the value of a property value.


Value functions#

env()#

The env() function can be used to insert the value of a defined environment variable.


Background functions#

url()#

The url() function is used to include a file. The parameter is an absolute URL, a relative URL, or a data URI.

linear-gradient()#

The linear-gradient() function creates an image consisting of a progressive transition between two or more colors along a straight line.

radial-gradient()#

The radial-gradient() function creates an image consisting of a progressive transition between two or more colors that radiate from an origin. Its shape may be a circle or an ellipse.


Transition functions#

cubic-bezier()#

The cubic-bezier() function defines a Cubic Bezier curve for use with transitions.