get_css_styles
Inspect which CSS declaration wins for an element and what it overrides — selector, stylesheet, rule position, !important, @layer — to debug why a style applies.
Instructions
Why an element looks the way it does: for each CSS property the winning declaration — selector, stylesheet, rule position, !important, @layer, @media — and the ones it overrides, like the Styles panel of DevTools; query_dom gives the computed value, this gives who set it. Read-only, from the CSSOM: stylesheets of another origin without CORS are opaque and listed by href; user-agent styles, @container and @scope rules are not evaluated. properties narrows the output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | No | Target tab; omitted = last tab navigated in this session, else the active one | |
| frame_id | No | Target iframe id from get_frames; omitted = main frame | |
| selector | Yes | CSS selector; ">>>" pierces shadow DOM. Only the first match is inspected | |
| properties | No | Only these, e.g. ["margin-top","--brand"]; margin covers its longhands. Omitted = every property a matching rule sets | |
| include_inherited | No | Also inherited properties (color, font-*, custom properties) with the ancestor that sets them |