CSS contrast pairs
css_contrast_pairsExtracts real foreground and background color pairs from CSS instead of guessing roles from token names. Pass a public url (the page, its style blocks and up to 12 linked stylesheets are fetched) or paste css (and optionally html for its style blocks). For every rule that sets color, it finds the background set by the same rule, by an ancestor named in the selector, or by body/html, resolves var() custom properties, light-dark() and prefers-color-scheme / [data-theme] / .dark variants, and applies opacity. Returns WCAG ratio, APCA Lc, the threshold (large text 3, otherwise 4.5), file and line for each failing pair, a list of thin margins, a list of pairs whose background is assumed (only the page root or the browser default was available), and text over images or gradients that cannot be computed. Optional scheme (both, light, dark) and viewport (width in px for min-width/max-width media queries, default 1280). Reads CSS only: no rendering, inline style attributes, script, or text over photographs.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "css_contrast_pairs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | CSS source to check. | |
| url | No | A public page URL to fetch. | |
| html | No | Optional HTML whose <style> blocks are read. | |
| scheme | No | Which color scheme to evaluate. Default both. | |
| viewport | No | Viewport width in px for width media queries. Default 1280. |