Architecture and performance audit
Definition and purpose
A professional audit starts with a reproducible problem, proposes a targeted fix, then compares evidence before and after. Audit a fixed-width account card, missing focus outline and undersized control before making any performance claims.
Before: intentional defects
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } * { box-sizing: border-box; } #page { width: 680px; } .card { background: white; color: #172033; padding: 16px; } #act { background: #ddd; color: #222; min-height: 20px; } #act:focus { outline: none; } </style> </head> <body> <main id="page"> <h1>Audit report</h1> <article id="a" class="card"> <h2>Account</h2> <p id="long">Reference: customer-record-2026-very-long-unbroken-identifier</p> <button id="act">Review</button> </article> </main> </body></html>The fixed width overflows at 375px, and the focused button has no outline. This intentionally defective version is for diagnosis only.
Syntax and mental model
In the before example the 680px page is wider than a narrow viewport, the focus outline is deliberately suppressed, and the control has a 20px minimum. In the after example constrain the inline size to min(100%, 680px), enable long-word wrapping, give the button a 44px minimum and a visible focus outline. Named layers provide an explicit normal-author ordering; they do not automatically improve speed. Write a finding with the exact selector, failing width/state, expected outcome, measured outcome and remediation. Transfer task: inspect the previous three capstone fixtures and submit a table of at least five findings, including one cascade conflict, one narrow-layout problem, one keyboard or reduced-motion problem, and one potential rendering-cost problem. Preserve the before source and test after each change. For rendering cost, record the same interaction in DevTools before and after under identical conditions and report measured durations or say NOT RUN. A width or focus assertion demonstrates a local effect, not a CLS or frame-rate score. Use computed styles to explain precedence and record the viewport, browser version, test steps and limitations; do not declare WCAG conformance from selected checks.
After: targeted repair
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } * { box-sizing: border-box; } @layer base, components; @layer base { #page { inline-size: min(100%, 680px); } } @layer components { .card { min-inline-size: 0; overflow-wrap: anywhere; background: white; color: #172033; padding: 16px; } #act { background: #1d4ed8; color: white; min-block-size: 44px; border: 1px solid #1d4ed8; } #act:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 3px; } } </style> </head> <body> <main id="page"> <h1>Audit report</h1> <article id="a" class="card"> <h2>Account</h2> <p id="long">Reference: customer-record-2026-very-long-unbroken-identifier</p> <button id="act">Review</button> </article> </main> </body></html>The page width now follows its container at narrow sizes, the long identifier can wrap, and the keyboard focus is visible. Record these as local remediation checks.
Common mistakes
Do not replace a fixed-width bug with overflow: hidden, which can merely conceal inaccessible content. Do not add !important to every rule to resolve a cascade conflict. Do not claim that adding layers, changing selector names or switching to transform alone proves a speedup.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Animation and progressive enhancement project.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Architecture and performance audit — knowledge check
Five questions on architecture and performance audit.
What makes an audit finding actionable?
Why is overflow: hidden not a sufficient fixed-width repair?
What do cascade layers primarily control?
What is needed to claim a performance improvement?
What should remain in the final report?