← Back to CSS domain

CSS.setStyleSheetText

Sets the new stylesheet text.

Domain: CSS experimental

Parameters

NameTypeDescription
styleSheetIdDOM.StyleSheetId
textstring

Returns

NameTypeDescription
sourceMapURLstringURL of source map associated with script (if any).

Example Request

{
  "id": 1,
  "method": "CSS.setStyleSheetText",
  "params": {
    "styleSheetId": "styleSheetId-value",
    "text": "text-value"
  }
}

Example Response

{
  "id": 1,
  "result": {
    "sourceMapURL": "sourceMapURL-value"
  }
}

Usage in Node.js

const result = await send('CSS.setStyleSheetText', {"styleSheetId": "styleSheetId-value", "text": "text-value"});
console.log(result);
// {"sourceMapURL": "sourceMapURL-value"}