From bce55b26a288cad8b0beefb74debc8763c7a76d9 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Tue, 15 Sep 2026 03:15:24 +0200 Subject: [PATCH] Require range syntax for every stylesheet's media queries Plan step 37 review. Folding the layout-only checks into the all.css-wide ones dropped the layout test's requirement that a width query be written as a range (`width >= 840px`), leaving only its unit and breakpoint checked. The all.css-wide media query test now rejects min-/max- width, height and aspect-ratio features in every stylesheet, which the package already never writes. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- tests/Feature/StylesheetsTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Feature/StylesheetsTest.php b/tests/Feature/StylesheetsTest.php index f4c21d0b..c896455e 100644 --- a/tests/Feature/StylesheetsTest.php +++ b/tests/Feature/StylesheetsTest.php @@ -324,6 +324,10 @@ it('writes a media query, anywhere all.css reaches, only at M3\'s breakpoints, i && preg_match('/(?:^|[\s:<>=(])(?:min-|max-)?height\b/', $feature) === 1 && ! str_contains($feature, 'width'); + // Range syntax (`width >= 840px`, `840px <= width < 1200px`), as the layout stylesheets' + // own check required before it folded into this one: never `min-width`/`max-width`. + expect($feature)->not->toMatch('/\b(?:min|max)-(?:width|height|aspect-ratio)\b/', "{$query} is not written as a range"); + preg_match_all('/(\d*\.?\d+)([a-z%]*)/i', $feature, $lengths, PREG_SET_ORDER); foreach ($lengths as [, $number, $unit]) {