mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-20 18:16:30 +03:00
Skip unresolved container query CSS
Exclude linked container-query groups when their current applicability cannot be resolved, with a browser regression proving inactive styles do not leak. AI assistance disclosure: This commit was prepared with Codex under maintainer direction.
This commit is contained in:
@@ -1405,6 +1405,11 @@ describe('detectUrl — browser-only fixtures', () => {
|
||||
})));
|
||||
const linkedFindings = await linkedPage.evaluate(() => window.impeccableDetect({ serialize: true })
|
||||
.flatMap(group => group.findings || []));
|
||||
const inactiveContainerBackground = await linkedPage.$eval(
|
||||
'.inactive-container-stripes',
|
||||
element => getComputedStyle(element).backgroundImage,
|
||||
);
|
||||
assert.equal(inactiveContainerBackground, 'none');
|
||||
const grids = linkedFindings.filter(finding => finding.type === 'codex-grid-background');
|
||||
assert.equal(grids.length, 1, JSON.stringify({ linkedFindings, linkedCssom }));
|
||||
assert.equal(grids[0].severity, 'advisory');
|
||||
|
||||
@@ -40,6 +40,17 @@ main > ::before {
|
||||
}
|
||||
}
|
||||
|
||||
.container-query-host {
|
||||
container-type: inline-size;
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
@container (width > 900px) {
|
||||
.inactive-container-stripes {
|
||||
background: repeating-linear-gradient(45deg, #eee, #eee 10px, #fafafa 10px, #fafafa 20px);
|
||||
}
|
||||
}
|
||||
|
||||
.unused-linked-transition {
|
||||
transition: width 200ms ease;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
<div class="flag-linked-grid">Rendered decorative grid</div>
|
||||
<div class="inactive-media-stripes">Inactive media stripes</div>
|
||||
<div class="inactive-supports-stripes">Inactive supports stripes</div>
|
||||
<div class="container-query-host">
|
||||
<div class="inactive-container-stripes">Inactive container-query stripes</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user