When to use it: Use before publishing any web page or site change (landing pages, websites, product UI): a slim pre-deploy check for speed, security headers, accessibility and layout, based on Chrome's Modern Web Guidance. Run it on the noindex draft.
Modern web pre-deploy checklist
Reference: GoogleChrome/modern-web-guidance-src (CLI: npx modern-web-guidance@latest search|retrieve <topic>). Main guides:
- guides/performance/performance/guide.md
- guides/security/security/guide.md
- guides/accessibility/accessibility/guide.md
- guides/html/html/guide.md
- guides/css/css/guide.md
- guides/performance/optimize-image-priority/guide.md
- guides/visual-design/color/guide.md
Before
- Run Lighthouse mobile on the live pages you'll touch, and save the JSON with the before scores.
- Take full-page screenshots of those pages at 390 and 1440.
Checklist (on the noindex draft)
- Images: use WebP or AVIF at the size actually shown. Flag any image over about 200 KB and any tiny icon served large.
- Load order: the LCP image gets fetchpriority="high" and is never lazy. Everything below the fold gets loading="lazy" decoding="async". Images inside a closed dialog or pop-up load only when it opens.
- Image sizes: every img, and every picture source with a different aspect, has width and height, so CLS is 0.
- Contrast: text contrast is at least 4.5:1, including small counts and labels.
- Charset:
<meta charset>comes first in<head>. - Safe DOM: use textContent or createElement instead of innerHTML for messages and any user or form text.
-
Security headers (for example a Netlify
_headersfile): - X-Content-Type-Options nosniff - Referrer-Policy strict-origin-when-cross-origin - Permissions-Policy - X-Frame-Options DENY plus CSP frame-ancestors 'none' - Content-Security-Policy-Report-Only that allows only what the page uses Then load every page, open the pop-ups and submit the forms with the request faked, and confirm there are 0 CSP violations. -
Indexing: the draft is noindex (meta tag and X-Robots-Tag), and prod is not.
- Layout: there's no sideways scroll at 390 or 1440, and the screenshots match the before shots except for intended changes.
- Working parts: all links and downloads return 200, analytics fires, and forms work.
- Downloads: on pages that offer a file for download, the shown content matches the downloadable file.
- After scores: rerun Lighthouse on the same pages and report the before and after numbers you actually saw.
After prod
Record the rollback deploy id first. Deploy only with the owner's OK (or a standing OK) and after the team's QA pass, unless the owner skips it. Then repeat checks 8-10 and 12 on the live site.
Optional one-off
npx modern-web-guidance@latest legacy-scan . lists outdated patterns. Use it for review, not as a gate.