inject_css
Inject CSS into a live page to trial fixes or hide overlays without touching source files. Revert changes instantly.
Instructions
Apply CSS to the LIVE page without touching source files — either declarations trialed on one element (applied !important so the trial always wins; reports which computed properties changed) or a raw page-wide rule block. THE fix-loop tool: explain_styles names the winning rule → inject_css the candidate fix → verify with measure_element/style_diff/annotated_screenshot → write the final declarations into the source once → revert:'all'. This replaces the slow edit-file → cache-bust → reload → re-snapshot cycle. Also the quick way to hide a cookie/consent overlay that occludes what you need (inject 'display:none'). Patches are trial-only: gone on navigation or revert.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | Raw CSS rule block(s) to inject page-wide, e.g. ".onetrust-banner { display: none }" | |
| uid | No | Element uid to patch (from page_snapshot / find_elements) | |
| revert | No | Remove a previous patch by id (e.g. 'p2'), or 'all' to remove every patch | |
| selector | No | CSS selector (first match) — alternative to uid | |
| declarations | No | Declarations to trial on the target, e.g. "align-items: center; margin-top: 4px". Applied with !important so the trial always wins; requires uid or selector. |