This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id
used in subsequent operations on the related object. Each object type has a specific id
structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode()
calls (which accept a DOM node id). A client can also keep track of stylesheets via the styleSheetAdded
/styleSheetRemoved
events and subsequently load the required stylesheet contents using the getStyleSheet[Text]()
methods.
This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated `id` used in subsequent operations on the related object. Each object type has a specific `id` structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.
(add-rule)
(add-rule {:as params :keys [style-sheet-id rule-text location]})
(add-rule connection {:as params :keys [style-sheet-id rule-text location]})
Inserts a new rule with the given ruleText
in a stylesheet with given styleSheetId
, at the position specified by location
.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | The css style sheet identifier where a new rule should be inserted. |
:rule-text | The text of a new rule. |
:location | Text position of a new rule in the target style sheet. |
Return map keys:
Key | Description |
---|---|
:rule | The newly created rule. |
Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the position specified by `location`. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | The css style sheet identifier where a new rule should be inserted. :rule-text | The text of a new rule. :location | Text position of a new rule in the target style sheet. Return map keys: Key | Description ------|------------ :rule | The newly created rule.
(collect-class-names)
(collect-class-names {:as params :keys [style-sheet-id]})
(collect-class-names connection {:as params :keys [style-sheet-id]})
Returns all class names from specified stylesheet.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | null |
Return map keys:
Key | Description |
---|---|
:class-names | Class name list. |
Returns all class names from specified stylesheet. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | null Return map keys: Key | Description -------------|------------ :class-names | Class name list.
(create-style-sheet)
(create-style-sheet {:as params :keys [frame-id]})
(create-style-sheet connection {:as params :keys [frame-id]})
Creates a new special "via-inspector" stylesheet in the frame with given frameId
.
Parameters map keys:
Key | Description |
---|---|
:frame-id | Identifier of the frame where "via-inspector" stylesheet should be created. |
Return map keys:
Key | Description |
---|---|
:style-sheet-id | Identifier of the created "via-inspector" stylesheet. |
Creates a new special "via-inspector" stylesheet in the frame with given `frameId`. Parameters map keys: Key | Description ----------|------------ :frame-id | Identifier of the frame where "via-inspector" stylesheet should be created. Return map keys: Key | Description ----------------|------------ :style-sheet-id | Identifier of the created "via-inspector" stylesheet.
(disable)
(disable {:as params :keys []})
(disable connection {:as params :keys []})
Disables the CSS agent for the given page.
Disables the CSS agent for the given page.
(enable)
(enable {:as params :keys []})
(enable connection {:as params :keys []})
Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received.
Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been enabled until the result of this command is received.
(force-pseudo-state)
(force-pseudo-state {:as params :keys [node-id forced-pseudo-classes]})
(force-pseudo-state connection
{:as params :keys [node-id forced-pseudo-classes]})
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
Parameters map keys:
Key | Description |
---|---|
:node-id | The element id for which to force the pseudo state. |
:forced-pseudo-classes | Element pseudo classes to force when computing the element's style. |
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser. Parameters map keys: Key | Description -----------------------|------------ :node-id | The element id for which to force the pseudo state. :forced-pseudo-classes | Element pseudo classes to force when computing the element's style.
(get-background-colors)
(get-background-colors {:as params :keys [node-id]})
(get-background-colors connection {:as params :keys [node-id]})
Parameters map keys:
Key | Description |
---|---|
:node-id | Id of the node to get background colors for. |
Return map keys:
Key | Description |
---|---|
:background-colors | The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). (optional) |
:computed-font-size | The computed font size for this node, as a CSS computed value string (e.g. '12px'). (optional) |
:computed-font-weight | The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). (optional) |
:computed-body-font-size | The computed font size for the document body, as a computed CSS value string (e.g. '16px'). (optional) |
Parameters map keys: Key | Description ---------|------------ :node-id | Id of the node to get background colors for. Return map keys: Key | Description -------------------------|------------ :background-colors | The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load). (optional) :computed-font-size | The computed font size for this node, as a CSS computed value string (e.g. '12px'). (optional) :computed-font-weight | The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100'). (optional) :computed-body-font-size | The computed font size for the document body, as a computed CSS value string (e.g. '16px'). (optional)
(get-computed-style-for-node)
(get-computed-style-for-node {:as params :keys [node-id]})
(get-computed-style-for-node connection {:as params :keys [node-id]})
Returns the computed style for a DOM node identified by nodeId
.
Parameters map keys:
Key | Description |
---|---|
:node-id | null |
Return map keys:
Key | Description |
---|---|
:computed-style | Computed style for the specified DOM node. |
Returns the computed style for a DOM node identified by `nodeId`. Parameters map keys: Key | Description ---------|------------ :node-id | null Return map keys: Key | Description ----------------|------------ :computed-style | Computed style for the specified DOM node.
(get-inline-styles-for-node)
(get-inline-styles-for-node {:as params :keys [node-id]})
(get-inline-styles-for-node connection {:as params :keys [node-id]})
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId
.
Parameters map keys:
Key | Description |
---|---|
:node-id | null |
Return map keys:
Key | Description |
---|---|
:inline-style | Inline style for the specified DOM node. (optional) |
:attributes-style | Attribute-defined element style (e.g. resulting from "width=20 height=100%"). (optional) |
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by `nodeId`. Parameters map keys: Key | Description ---------|------------ :node-id | null Return map keys: Key | Description ------------------|------------ :inline-style | Inline style for the specified DOM node. (optional) :attributes-style | Attribute-defined element style (e.g. resulting from "width=20 height=100%"). (optional)
(get-matched-styles-for-node)
(get-matched-styles-for-node {:as params :keys [node-id]})
(get-matched-styles-for-node connection {:as params :keys [node-id]})
Returns requested styles for a DOM node identified by nodeId
.
Parameters map keys:
Key | Description |
---|---|
:node-id | null |
Return map keys:
Key | Description |
---|---|
:inline-style | Inline style for the specified DOM node. (optional) |
:attributes-style | Attribute-defined element style (e.g. resulting from "width=20 height=100%"). (optional) |
:matched-css-rules | CSS rules matching this node, from all applicable stylesheets. (optional) |
:pseudo-elements | Pseudo style matches for this node. (optional) |
:inherited | A chain of inherited styles (from the immediate node parent up to the DOM tree root). (optional) |
:css-keyframes-rules | A list of CSS keyframed animations matching this node. (optional) |
Returns requested styles for a DOM node identified by `nodeId`. Parameters map keys: Key | Description ---------|------------ :node-id | null Return map keys: Key | Description ---------------------|------------ :inline-style | Inline style for the specified DOM node. (optional) :attributes-style | Attribute-defined element style (e.g. resulting from "width=20 height=100%"). (optional) :matched-css-rules | CSS rules matching this node, from all applicable stylesheets. (optional) :pseudo-elements | Pseudo style matches for this node. (optional) :inherited | A chain of inherited styles (from the immediate node parent up to the DOM tree root). (optional) :css-keyframes-rules | A list of CSS keyframed animations matching this node. (optional)
(get-media-queries)
(get-media-queries {:as params :keys []})
(get-media-queries connection {:as params :keys []})
Returns all media queries parsed by the rendering engine.
Return map keys:
Key | Description |
---|---|
:medias | null |
Returns all media queries parsed by the rendering engine. Return map keys: Key | Description --------|------------ :medias | null
(get-platform-fonts-for-node)
(get-platform-fonts-for-node {:as params :keys [node-id]})
(get-platform-fonts-for-node connection {:as params :keys [node-id]})
Requests information about platform fonts which we used to render child TextNodes in the given node.
Parameters map keys:
Key | Description |
---|---|
:node-id | null |
Return map keys:
Key | Description |
---|---|
:fonts | Usage statistics for every employed platform font. |
Requests information about platform fonts which we used to render child TextNodes in the given node. Parameters map keys: Key | Description ---------|------------ :node-id | null Return map keys: Key | Description -------|------------ :fonts | Usage statistics for every employed platform font.
(get-style-sheet-text)
(get-style-sheet-text {:as params :keys [style-sheet-id]})
(get-style-sheet-text connection {:as params :keys [style-sheet-id]})
Returns the current textual content and the URL for a stylesheet.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | null |
Return map keys:
Key | Description |
---|---|
:text | The stylesheet text. |
Returns the current textual content and the URL for a stylesheet. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | null Return map keys: Key | Description ------|------------ :text | The stylesheet text.
(set-effective-property-value-for-node)
(set-effective-property-value-for-node {:as params
:keys [node-id property-name value]})
(set-effective-property-value-for-node connection
{:as params
:keys [node-id property-name value]})
Find a rule with the given active property for the given node and set the new value for this property
Parameters map keys:
Key | Description |
---|---|
:node-id | The element id for which to set property. |
:property-name | null |
:value | null |
Find a rule with the given active property for the given node and set the new value for this property Parameters map keys: Key | Description ---------------|------------ :node-id | The element id for which to set property. :property-name | null :value | null
(set-keyframe-key)
(set-keyframe-key {:as params :keys [style-sheet-id range key-text]})
(set-keyframe-key connection {:as params :keys [style-sheet-id range key-text]})
Modifies the keyframe rule key text.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | null |
:range | null |
:key-text | null |
Return map keys:
Key | Description |
---|---|
:key-text | The resulting key text after modification. |
Modifies the keyframe rule key text. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | null :range | null :key-text | null Return map keys: Key | Description ----------|------------ :key-text | The resulting key text after modification.
(set-media-text)
(set-media-text {:as params :keys [style-sheet-id range text]})
(set-media-text connection {:as params :keys [style-sheet-id range text]})
Modifies the rule selector.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | null |
:range | null |
:text | null |
Return map keys:
Key | Description |
---|---|
:media | The resulting CSS media rule after modification. |
Modifies the rule selector. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | null :range | null :text | null Return map keys: Key | Description -------|------------ :media | The resulting CSS media rule after modification.
(set-rule-selector)
(set-rule-selector {:as params :keys [style-sheet-id range selector]})
(set-rule-selector connection
{:as params :keys [style-sheet-id range selector]})
Modifies the rule selector.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | null |
:range | null |
:selector | null |
Return map keys:
Key | Description |
---|---|
:selector-list | The resulting selector list after modification. |
Modifies the rule selector. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | null :range | null :selector | null Return map keys: Key | Description ---------------|------------ :selector-list | The resulting selector list after modification.
(set-style-sheet-text)
(set-style-sheet-text {:as params :keys [style-sheet-id text]})
(set-style-sheet-text connection {:as params :keys [style-sheet-id text]})
Sets the new stylesheet text.
Parameters map keys:
Key | Description |
---|---|
:style-sheet-id | null |
:text | null |
Return map keys:
Key | Description |
---|---|
:source-map-url | URL of source map associated with script (if any). (optional) |
Sets the new stylesheet text. Parameters map keys: Key | Description ----------------|------------ :style-sheet-id | null :text | null Return map keys: Key | Description ----------------|------------ :source-map-url | URL of source map associated with script (if any). (optional)
(set-style-texts)
(set-style-texts {:as params :keys [edits]})
(set-style-texts connection {:as params :keys [edits]})
Applies specified style edits one after another in the given order.
Parameters map keys:
Key | Description |
---|---|
:edits | null |
Return map keys:
Key | Description |
---|---|
:styles | The resulting styles after modification. |
Applies specified style edits one after another in the given order. Parameters map keys: Key | Description -------|------------ :edits | null Return map keys: Key | Description --------|------------ :styles | The resulting styles after modification.
(start-rule-usage-tracking)
(start-rule-usage-tracking {:as params :keys []})
(start-rule-usage-tracking connection {:as params :keys []})
Enables the selector recording.
Enables the selector recording.
(stop-rule-usage-tracking)
(stop-rule-usage-tracking {:as params :keys []})
(stop-rule-usage-tracking connection {:as params :keys []})
The list of rules with an indication of whether these were used
Return map keys:
Key | Description |
---|---|
:rule-usage | null |
The list of rules with an indication of whether these were used Return map keys: Key | Description ------------|------------ :rule-usage | null
(take-coverage-delta)
(take-coverage-delta {:as params :keys []})
(take-coverage-delta connection {:as params :keys []})
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation)
Return map keys:
Key | Description |
---|---|
:coverage | null |
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation) Return map keys: Key | Description ----------|------------ :coverage | null
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close