First Public Working Draft · css-link-params

CSS Linked Parameters Module

1 property, 1 function defined by this specification, all known to at least one browser .

Each feature in detail

param()

Function Experimental

Spec All three methods of setting link parameters share the same syntax for defining a parameter, using the param() function:

MDN The param() CSS function is used to set link parameters. It can be used in the link-parameters CSS property, in the URL fragment of an external resource, or in the <url-modifier> of the url() CSS function.

Live preview Example from MDN
.squares {
  height: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
img {
  height: 100%;
}

.greyscale {
  link-parameters:
    param(--color1, slategrey),
    param(--color2, lightgrey);
  &:hover {
    link-parameters:
      param(--color1, lightgrey),
      param(--color2, slategrey);
  }
}
.high-contrast {
  link-parameters:
    param(--color1, fuchsia),
    param(--color2, yellow);
  &:hover {
    link-parameters:
      param(--color1, yellow),
      param(--color2, fuchsia);
  }
}

Syntax

param( <param-spec> , <declaration-value>? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting param()
Chrome No
Edge No
Firefox Preview
Safari No
Chrome Android No
Safari iOS No

First version with support, from MDN browser-compat-data.