Lint
This commit is contained in:
parent
d83691323f
commit
f5f017b01f
14 changed files with 103 additions and 46 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue