Locked Video

Please log in or buy the course to watch

Buy Now

Color Opacity Modifier

Color opacity modifiers are used to alter the transparency of an existing color token. They help to blend elements with backgrounds or achieve specific design effects.

Color opacity modifiers can only be applied to color-related CSS properties, such as border-color, color, outline-color, background-color, etc.

Syntax for Color Opacity Modifiers

  • Format: {color}/{opacity}

For example, to express a 40% transparency on a gray.200 tokenToString, we express it as: gray.200/40.

Panda converts this to the native CSS color-mix syntax:

color-mix(in srgb, var(--colors-gray-200) 40%, transparent)