This commit is contained in:
Andras Schmelczer 2026-05-28 14:27:52 +01:00
parent d83691323f
commit f5f017b01f
14 changed files with 103 additions and 46 deletions

View file

@ -158,7 +158,10 @@ async function checkPreviewCroppingStyles() {
for (const match of css.matchAll(blockPattern)) {
const selector = match[1].replace(/\/\*[\s\S]*?\*\//g, '').trim();
const body = match[2];
if (!selector || !/thumbnail|preview/i.test(selector)) continue;
// Only inspect rules that target elements explicitly opted in to the
// no-crop contract via [data-uncropped-preview]. Listing thumbnails
// that intentionally cover-crop don't carry this attribute.
if (!selector || !/\[data-uncropped-preview\b/.test(selector)) continue;
const targetsMedia = /\b(img|picture|video|canvas)\b/i.test(selector);
const objectFit = declarationValue(body, 'object-fit');