{
  "slug": "playwright-locator-highlights-accept-custom-styles-d0ffac583d44",
  "title": "Playwright locator highlights accept custom styles",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-11T19:08:18.000Z",
  "announced_at": "2026-05-11T19:08:18.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When visually inspecting a locator, call `locator.highlight({ style })` to add inline CSS to its overlay, then call `page.hideHighlight()` to clear all locator highlight overlays on that page.",
    "examples": [
      "await page.locator('<selector>').highlight({ style: 'outline: 2px dashed red' });\nawait page.hideHighlight();"
    ],
    "gotchas": [
      "Version: v1.60.0",
      "options.style: Inline CSS for the highlight overlay. Accepts a CSS string or an object of string, string-or-number values. The docs do not state these forms are mutually exclusive.",
      "selector (required): Selector used by `page.locator()` to resolve the DOM element.",
      "Prerequisite: Use Playwright v1.60.0 or later; `style` and `page.hideHighlight()` were added in v1.60."
    ]
  },
  "why_it_matters": "Visually inspect a highlighted locator and then clear page highlights.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.60.0",
    "https://playwright.dev/docs/api/class-locator#locator-highlight",
    "https://playwright.dev/docs/api/class-page#page-locator"
  ],
  "rank": 0.95011,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-15228fe3d33f40e5-9:gate",
    "evidence_hash": "8d2217b180ed48f8295026249b4e63507609b51ecea3842ff24b521ee9c9c11e"
  },
  "review": {
    "draft_hash": "3529cb639548d9112b4702f1b5a79b00136e6ef6eeaef4659d7f733fdf535f64",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.61 (>= 0.6 needed)."
  }
}
