Patch
Selectable before-and-after code sits beside actual isolated CSS boxes, bounded inspection windows and explicit outer-versus-content widths.
Design study · 4 slides
Using Claude Code or Codex? Install the free presentation skill.
Source and instructions
Source notes
PATCH / Frozen worked CSS width lesson
Purpose: explain one isolated width-rule change using native code, before/after examples and two known host widths. This is a first-party teaching fixture, not a patch to an actual application or a complete responsiveness/accessibility/performance review.
Both examples are ordinary block boxes with no parent flex/grid, no margin, no inherited min-width and no other width constraints. Host content widths are320px and600px. All pixels in this lesson are CSS pixels.
BEFORE exact width-relevant CSS:
.demo.before {
box-sizing: border-box;
width: 480px;
padding: 24px;
border: 2px solid;
}
AFTER exact width-relevant CSS:
.demo.after {
box-sizing: border-box;
width: 100%;
max-width: 480px;
padding: 24px;
border: 2px solid;
}
The2px border is on each side, as is24px padding. Decorative colors and a100px example height may be added; no other width-affecting rule may alter the result.
Before border-box outer width480px in both hosts. In320px host it extends160px beyond the host; in600px host it leaves120px spare. Content width428px in either before case.
After outer width is320px in320px host and480px in600px host. Corresponding content widths are268px and428px: outer minus48px padding minus4px border. There is no after overflow in either host; the600px host still has120px spare. The illustrated change removes the fixed width and adds width100% plus max-width480px; padding, border and border-box stay unchanged.
Render the actual CSS as isolated native examples and measure the outer geometry after safe rendering; do not substitute a fake screenshot or only a diagram. Any horizontal inspection window remains bounded, hinted, keyboard-focusable and usable to both ends. Before-case child overflow is intentional demonstration inside that window, not permission for page overflow.
Bounded conclusion: the after rule fits these two hosts while retaining the480px cap. This does not establish that every viewport, content length, zoom state, browser, interaction or actual application is accessible or fully responsive.
Primary reference checked before authoring: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/width ; https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/max-width ; https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/box-sizing . The fixture and calculations are original; no MDN example or prose is reproduced.
Four-slide independently authored code-teaching design study, not a released-recipe evaluation output.
Design instructions
Patch: a code-change teaching language in forest-black #102b27, pale live text #e5f0e9, mint additions #d2f1cb and warm removal text #ffddcf. Use native selectable code, restrained diff gutters, explicit before/after file bars and actual isolated browser examples; retain the same code identifiers and measurement units across the story. A diff is explanatory text, not proof that an application was changed. Display the exact source rules with unchanged context and demonstrate only the properties the source supports. For width examples, declare box sizing, parent layout and all relevant padding, borders, minimums and caps before calculating sizes. Measure actual native geometry after safe rendering rather than relying on a screenshot or source arithmetic alone. Put intentional fixture overflow inside a visibly hinted, bounded, keyboard-focusable inspection window with access to both ends; never let the whole page overflow or hide the failure. Keep code readable on phones through wrapping and reflow, preserving its underlying text. The complete native code-and-fixture composition needs no imagery. Omit optional generated atmosphere when unavailable and retain the code, examples and results; required real-application evidence remains a dependency. Keep a bounded property lesson separate from a complete responsiveness, accessibility, content, browser or performance claim.
Use my supplied content and the format I requested. Keep its facts, numbers, denominators, uncertainty and conclusion. Do not inherit the example deck’s story, figures or recommendation. The visual direction guides design; the audience and argument determine the slide sequence.
Check the tools available in this session. When an image would improve the presentation and a suitable generation tool is available, generate an original image or use an asset I am authorized to supply. If optional generation is unavailable or fails, continue with a complete image-free composition. Reclaim the space, leave no placeholders, and do not ask me to enable a tool or delay the deck for optional imagery. Mention a failure in the handoff rather than on audience-facing slides. If I explicitly require a particular image, preserve that requirement and explain any unmet dependency.
Keep text and evidence selectable. For HTML, use one self-contained static document with embedded CSS, compressed data images and licensed embedded fonts when needed; do not add scripts, forms, remote calls or authored slide controls. Preserve font licenses and asset provenance. Label conceptual or generated imagery when it could be mistaken for real product, customer or event evidence. Never invent a product screenshot to prove a feature.
Render every slide and inspect the actual result before handing it over. Check crop, contrast, type hierarchy, labels, overflow and source fidelity. Use at least 4.5:1 contrast for body text and 3:1 for large text. Check the destination’s file/data-image limits before any separately authorized publication. If visual checking is unavailable, say so in the handoff.About this design study
Four teaching slides compare a fixed 480-pixel border box with a host-relative width capped at 480 pixels, using actual 320- and 600-pixel hosts and unchanged padding and borders. Independently authored worked CSS lesson using native examples and cited primary property references. It is not a patch to an actual application, fake product screenshot or complete responsiveness, browser, content, interaction or accessibility review.
