← Back to CSS domain

CSS.setStyleTexts

Applies specified style edits one after another in the given order.

Domain: CSS experimental

Parameters

NameTypeDescription
editsarray
nodeForPropertySyntaxValidation (optional)DOM.NodeIdNodeId for the DOM node in whose context custom property declarations for registered properties should be validated. If omitted, declarations in the new rule text can only be validated statically, which may produce incorrect results if the declaration contains a var() for example.

Returns

NameTypeDescription
stylesarrayThe resulting styles after modification.

Example Request

{
  "id": 1,
  "method": "CSS.setStyleTexts",
  "params": {
    "edits": []
  }
}

Example Response

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

Usage in Node.js

const result = await send('CSS.setStyleTexts', {"edits": []});
console.log(result);
// {"styles": []}