← Back to CSS domain

CSS.resolveValues

Resolve the specified values in the context of the provided element. For example, a value of '1em' is evaluated according to the computed 'font-size' of the element and a value 'calc(1px + 2px)' will be resolved to '3px'. If the `propertyName` was specified the `values` are resolved as if they were property's declaration. If a value cannot be parsed according to the provided property syntax, the value is parsed using combined syntax as if null `propertyName` was provided. If the value cannot be resolved even then, return the provided value without any changes. Note: this function currently does not resolve CSS random() function, it returns unmodified random() function parts.`

Domain: CSS experimental

Parameters

NameTypeDescription
valuesarrayCascade-dependent keywords (revert/revert-layer) do not work.
nodeIdDOM.NodeIdId of the node in whose context the expression is evaluated
propertyName (optional)stringOnly longhands and custom property names are accepted.
pseudoType (optional)DOM.PseudoTypePseudo element type, only works for pseudo elements that generate elements in the tree, such as ::before and ::after.
pseudoIdentifier (optional)stringPseudo element custom ident.

Returns

NameTypeDescription
resultsarray

Example Request

{
  "id": 1,
  "method": "CSS.resolveValues",
  "params": {
    "values": [],
    "nodeId": 1
  }
}

Example Response

{
  "id": 1,
  "result": {
    "results": []
  }
}

Usage in Node.js

const result = await send('CSS.resolveValues', {"values": [], "nodeId": 1});
console.log(result);
// {"results": []}