<sign>

A math function that returns -1 for negative numbers, 0 for zero, and 1 for positive numbers. It's useful for logic-based styling directly in your CSS.

Quick example

.dynamic-element {
  /* Scale based on whether the --score variable is positive or negative */
  transform: scale(sign(var(--score)));
}

<sign> Browser Support

Newly available Since 2025 82% global usage

Since 2025 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Works in all modern browsers. May need a fallback for older browsers.

138+
118+
15.4+
138+
ESC