CSS Types and Functions are values that help compute dynamic styles, such as mathematical calculations, color manipulations, and image sources. Browse all 82 types & functions in our CSS Reference.
Absolute value function. Returns the non-negative value of a number.
91%Newly availableA trigonometric function that calculates the arccosine of a number. It's used in advanced CSS math for calculating angles in layouts or animations based on side lengths.
95%Widely availableA function that retrieves the width or height of the anchor element. It's useful for making a popup or menu match the exact dimensions of the button that triggered it.
Snippet →87%Newly availableAllows an element (like a tooltip or menu) to be docked to another element on the page, ensuring it stays positioned relative to that target even if the page scrolls or layout changes.
87%Newly availableA combination type that accepts either an explicit angle (like 45deg) or a percentage value that the browser converts into an angle based on a reference.
97%Widely availableA basic CSS type for rotation values. It can be expressed in degrees (deg), radians (rad), gradians (grad) or turns (turn).
97%Widely availableA mathematical function that calculates the arcsine (inverse sine) of a number. It's used in advanced CSS math to determine angles based on vertical distances in layouts or animations.
95%Widely availableA mathematical function that calculates the arctangent of a number. It calculates slope-based angles in CSS without JavaScript.
95%Widely availableA more advanced arctangent function that takes two numbers (y and x) to calculate the angle from the origin. It correctly handles all four quadrants, making it the most reliable tool for coordinate-based math in CSS.
95%Widely availableA CSS type that represents a geometric shape. These are used in properties like 'clip-path' and 'shape-outside' to create non-rectangular layouts, such as circles, polygons or rounded boxes.
97%Widely availableA type representing the mathematical way two colors mix together. Common values include 'multiply' (darkens), 'screen' (lightens), and 'overlay' (increases contrast), much like layer styles in Photoshop.
97%Widely availableA CSS type representing keywords that can be used inside mathematical functions like 'calc()'. Examples include 'e' (base of natural logarithms) and 'pi'.
96%Widely availableAn experimental function that allows performing math on 'intrinsic' sizes like 'auto', 'min-content' or 'fit-content'. This is a key part of making it possible to animate from 'height: 0' to 'height: auto'.
72%Limited availabilityAllows you to perform calculations when specifying CSS property values. You can mix different units, like percentages and pixels, in the same expression.
97%Widely availableRelative unit based on the height of capital letters. 1cap = cap height of the element's font.
52%Widely availableClamps a value between an upper and lower bound. It accepts a minimum, a preferred and a maximum value, which makes it a good fit for fluid typography.
97%Widely availableSets the foreground color of an element's text content. It accepts various formats like HEX, RGB, HSL and named colors.
95%Widely availableRepresents the specific keywords (like 'round', 'angle', 'bevel') that define how a corner should be shaped.
70%Limited availabilityA CSS math function that calculates the cosine of an angle. It's useful for circular layouts and animations in pure CSS.
95%Widely availableA function used in the 'content' property to display the current value of a CSS counter as text.
97%Widely availableSimilar to 'counter()', but used for nested counters (like 1.1, 1.2, 1.2.1). It combines the values of all counters with the same name into a single string.
97%Widely availableAn experimental type of CSS function name that starts with two dashes (like '--foo()'). It's intended to be used for custom, user-defined functions in the future.
70%Limited availabilityA general term for any CSS value that combines a number with a unit (like '10px', '2em' or '50%').
97%Widely availableAn experimental function that allows you to mix different dynamic range limits (like SDR and HDR) to fine-tune how colors are displayed on high-brightness screens.
71%Limited availabilityMathematical functions that control the speed of an animation over time (e.g., starting slow and ending fast). Common ones include 'ease-in', 'ease-out' and the customizable 'cubic-bezier()'.
97%Widely availableA function that allows you to use environment variables defined by the browser, most commonly used to handle 'safe areas' on devices with notches or rounded corners.
97%Widely availableExponential function. Calculates the mathematical constant e raised to a power.
94%Widely availableRefers to the specific functions used within the 'filter' property, such as 'blur()', 'contrast()', 'sepia()', or 'drop-shadow()'.
97%Widely availableA shorthand property that defines how a flex item grows or shrinks to fit the available space in its container.
97%Widely availableA value that is either a frequency (Hz, kHz) or a percentage. Combines two different value types.
40%Limited availabilityUnit for sound frequency (Hz, kHz). Used in audio and speech-related CSS properties.
40%Limited availabilitySpecial words like 'inherit', 'initial', 'unset' and 'revert' that can be used on almost any CSS property to control how it handles cascades or default values.
97%Widely availableA special image type that transitions smoothly between two or more colors. Common types include 'linear-gradient()', 'radial-gradient()', and 'conic-gradient()'.
97%Widely availableCalculates the hypotenuse of a right triangle. Useful for diagonal distances in layouts.
94%Widely availableAn experimental function that allows you to apply different values based on a condition (like a media query or a variable state) directly within a property value.
Snippet →71%Limited availabilityA generic CSS type representing any data that can be rendered as an image, including URLs (url()), gradients (linear-gradient()), or subsets of other images (image-set()).
97%Widely availableA CSS data type representing a whole number (positive, negative or zero). It is used in properties like 'z-index', 'flex-grow' or for counting items.
97%Widely availableA CSS data type that accepts either a length (like 20px) or a percentage (like 50%). It's used in properties like 'width', 'margin' and 'padding'.
97%Widely availableA CSS data type representing a distance value. It consists of a number followed by a unit (like 'px', 'em', 'rem', 'vw', etc.). Lengths fall into two big buckets: absolute units that map to physical sizes, and relative units that resolve based on context (the font, the viewport, the container, the line height).
97%Widely availableA CSS data type representing the 'style' of a line, used in properties like 'border-style' or 'outline-style'. Common values include 'solid', 'dashed' and 'dotted'.
97%Widely availableThe value type for border, outline and column rule widths. It takes a non-negative length like 2px or one of the keywords thin, medium and thick, which equal 1px, 3px and 5px.
97%Widely availableLogarithm function. Finds the power to which a base must be raised to equal a number.
94%Widely availableReturns the largest (most positive) value from a list of comma-separated expressions. It is useful for creating layouts that grow but don't shrink below a certain point.
97%Widely availableReturns the smallest (most negative) value from a list of comma-separated expressions. It is useful for creating layouts that shrink but don't grow beyond a certain point.
97%Widely availableA math function that returns the remainder of a division (modulo). This is useful for complex layouts where you need elements to repeat or cycle based on a value.
92%Newly availableA CSS data type representing a real number (which can include decimals). It's used for values like 'opacity', 'line-height' (as a multiplier), or in math functions.
97%Widely availableSets what happens if content is too big to fit into its container. It can be clipped, hidden or made to scroll.
97%Widely availableA CSS data type representing a value relative to something else (usually the parent element's size or another property's value).
97%Widely availableA value type for a point in a box, written with keywords and lengths, like center, top right or 25% 75%. background-position, object-position and offset-position use it.
97%Widely availableAn exponential math function that calculates a base raised to the power of an exponent. It's useful for creating non-linear scales (like font sizes or spacing).
94%Widely availableA relative math function that calculates how far a value is between two points (a start and an end). It returns a number between 0 and 1, essentially giving you a percentage of completion.
86%Newly availableA new CSS math function that picks a random value from a range of possibilities. This allows for native CSS randomness without needing JavaScript.
56%Limited availabilityA CSS data type representing the proportion of one side to another (like 16 / 9 for widescreen). It's primarily used in the aspect-ratio property or media queries.
97%Widely availableA function used in the motion path module to define a path that starts at a single point and shoots out in a specific direction (like a ray of light).
94%Widely availableRelative to the root element's cap height. Like rem but for cap units.
52%Newly availableRelative to the root element's character width (ch). Like rem but for character width.
52%Newly availableA CSS unit that is relative to the font-size of the root element (usually the <html> tag). Unlike 'em', it doesn't change based on the parent's font size, making scaling much more predictable.
92%Newly availableA CSS data type for pixel density, written with dpi, dpcm, dppx or x. You use it in resolution media queries and image-set() to give higher-quality images only to screens that can show the difference.
96%Widely availableRelative to the root element's x-height. Like rem but for x-height.
52%Newly availableRelative to the root element's CJK character width. Like rem but for CJK text.
52%Newly availableA math function that rounds a value to the nearest multiple of another value. For example, you can use it to ensure a width always rounds to the nearest 10 pixels.
92%Newly availableA basic data type that defines a 2D shape, like a circle, ellipse or polygon. It's most commonly used with the 'clip-path' property to cut elements into specific shapes or with 'shape-outside' to make text flow around them.
97%Limited availabilityReturns how many elements share the element's parent, the element itself included. It lets you style items by how many there are in a list, without JavaScript.
Snippet →86%Newly availableReturns the element's position among its siblings, counting from 1. Use it for staggered animations or styles that change along a list, without an nth-child() rule for each item.
Snippet →86%Newly availableReturns the sign of a number: -1, 0 or 1. Useful for conditional calculations.
91%Newly availableCalculates the sine of an angle. Part of the trigonometric function suite in CSS, allowing you to create complex circular layouts or wave-like animations.
95%Widely availableCalculates the square root of a number. This is part of the exponent function set in CSS, useful for relative scaling based on geometric areas.
94%Widely availableA basic data type that represents a sequence of characters, always wrapped in quotes (e.g., 'Hello'). It's most commonly used with the 'content' property in pseudo-elements.
97%Widely availableA new experimental function for 'corner-shaping' that creates 'squircle' corners. This is the math-based rounding used by Apple in iOS icons to make corners look smoother and more organic than a standard circle.
70%Limited availabilityCalculates the tangent of an angle. Useful for complex geometric translations or rotations directly in CSS.
95%Widely availableA value type used with 'text-box-edge' to define which lines of the font (like the top of capital letters, the x-height or the baseline) should be used as the boundaries for trimming.
87%Limited availabilityA value that is either a time (s, ms) or a percentage. Used in animations and transitions.
45%Limited availabilityThe standard CSS data type for durations. It can be defined in seconds (s) or milliseconds (ms).
97%Widely availableA generic data type representing any function that alters an element's coordinate system. This includes common functions like rotate(), scale(), translate(), and skew().
97%Widely availableA generic keyword used in newer CSS specs (like Mixins and Functions) to denote a specific data type requirement for a variable or argument.
70%Limited availabilityThe standard CSS function for including external resources like images, fonts or SVGs into your stylesheet.
97%Widely availableLets you insert the value of a custom property (CSS Variable) into your stylesheet, making it easier to reuse colors, spacing and other values across your design.
97%Widely availableRetrieves the value of an attribute from an element to use directly in CSS. The classic use is with the content property in pseudo-elements; using attr() with typed values on other properties is a newer extension with limited browser support.
Snippet →97%Widely availableBlends two colors together in a given color space. Pass two colors and a percentage, and the browser returns the mix. Use it to tint, shade or fade any color at runtime, no preprocessor needed.
Snippet →95%Widely availableA function that automatically selects a text color with the best contrast against a given background color. It helps dynamic themes keep text readable whatever the background.
Snippet →83%Newly availablePicks one of two colors based on the page's current color scheme. Pass a light-mode color and a dark-mode color, and the browser uses whichever matches color-scheme. No duplicate rules or media query needed.
Snippet →91%Newly availableA function used in 'clip-path' and other properties to define custom 2D shapes using commands like 'move', 'line' and 'curve'. It's basically like writing SVG paths directly in CSS.
Snippet →85%Newly availableNothing matches.