Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท At-rules

The @color-profile at-rule

Reference for the CSS @color-profile at-rule: load an ICC profile and use it with color(). Experimental, with very limited browser support.

The @color-profile at-rule gives a name to a color profile, usually an ICC file, so you can write colors in that space with the color() function. Think of print workflows: you could describe a press-specific CMYK profile and use its raw component values in CSS.

Limited support. This at-rule is part of CSS Color 5 and is not reliably available across browsers. Do not build on it for production work yet. Always provide a fallback color declared before the color() line.

CSS
@color-profile --press {
  src: url("/profiles/press.icc");
}

.logo { color: #c0392b; color: color(--press 0 0.8 0.7 0.1); }

Try it

Browsers that do not understand a color drop the whole declaration. That is exactly why the earlier fallback line matters. In this demo the profile name is never defined, so the second declaration is invalid and the first one stays in effect.

The fallback pattern

The first swatch is always plain red, because the custom profile does not exist. The second shows how the same pattern works with a predefined color space, which has much broader support.

Syntax

CSS
@color-profile <dashed-ident> | device-cmyk {
  src: url(<profile.icc>);
  rendering-intent: relative-colorimetric | absolute-colorimetric | perceptual | saturation;
  components: <name>, <name>, ...;
}

It is an at-rule, so initial value, inheritance and animatability do not apply.

Syntax and arguments

Part Description
Name A dashed identifier such as --press, used as the first argument of color().
device-cmyk A reserved name for a CMYK profile that overrides the default conversion.
src The location of the ICC profile. It is fetched like a font, so it is subject to CORS rules.
rendering-intent How out-of-gamut colors are mapped. The default is relative-colorimetric.
components Optional names for the profile's channels, for use in relative color syntax.

Usage notes

  • Declare a fallback first. Put an sRGB color in the line before any color(--name ...) value.
  • Profiles load lazily. Until the file arrives, the browser may use the fallback.
  • Channel values are numbers. In color(--press 0 0.8 0.7 0.1) the numbers follow the profile's channel order, typically in the 0 to 1 range.
  • Predefined spaces work today. For wide gamut, prefer color(display-p3 ...), oklch() and similar, which need no at-rule.
  • Screens are RGB. A CMYK profile is converted for display, so exact on-screen reproduction of a press color is not guaranteed.

Browser support

Very limited and experimental: do not rely on it in production and check current compatibility tables before testing. The predefined color spaces used by color() are widely supported.