Skip to content

Commit d7c19d0

Browse files
committed
fix: exclude max-width/min-width from mobile fixed-width check
The mobile compat regex was falsely flagging max-width values as fixed-width overflow risks. Added negative lookbehind to exclude max-width and min-width from the check.
1 parent cce6aa0 commit d7c19d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/website-sanity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ jobs:
312312
errors.append(f"{path}: has navbar but missing nav-toggle hamburger (mobile nav broken)")
313313
314314
# Check for fixed-width elements that break mobile
315-
for m in re.finditer(r'width\s*[:=]\s*(\d+)px', content):
315+
for m in re.finditer(r'(?<!max-)(?<!min-)width\s*[:=]\s*(\d+)px', content):
316316
px = int(m.group(1))
317317
if px > 500:
318318
line = content[:m.start()].count('\n') + 1

0 commit comments

Comments
 (0)