<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Design Den Solutions</title>
    <description>The latest articles on DEV Community by Design Den Solutions (@designden_solutions_89070).</description>
    <link>https://dev.to/designden_solutions_89070</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4022445%2F7c9a4105-d198-4081-9b58-8f56ab12b597.png</url>
      <title>DEV Community: Design Den Solutions</title>
      <link>https://dev.to/designden_solutions_89070</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/designden_solutions_89070"/>
    <language>en</language>
    <item>
      <title>Tap Targets Are Geometry, Not Taste: What WCAG 2.2's 24 Pixels Actually Measures</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Sun, 15 Nov 2026 19:34:49 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/tap-targets-are-geometry-not-taste-what-wcag-22s-24-pixels-actually-measures-1n6h</link>
      <guid>https://dev.to/designden_solutions_89070/tap-targets-are-geometry-not-taste-what-wcag-22s-24-pixels-actually-measures-1n6h</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uut7wb3msic3r5titp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uut7wb3msic3r5titp1.png" alt="Orange, black and white 3D editorial illustration: a smartphone whose screen shows three small dark buttons crowded together above one large orange button surrounded by a glowing spacing ring, with a stylised finger poised over the crowded ones. A Design Den Solutions panel carries the official logo, the headline TOO SMALL TO TAP - MEASURE THE GAP and the line &amp;quot;24 CSS pixels is the floor, spacing is the exception&amp;quot;, with +91 98721 90965 and www.designdensolutions.com shown." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Conceptual AI illustration of touch-target size and spacing on a mobile screen. Generated with AI assistance and reviewed for accuracy by Design Den Solutions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every conversation about touch targets collapses into one of two camps. One side says "44px or you're failing". The other says "WCAG only requires 24, so we're fine". Both are reasoning about the wrong quantity. SC 2.5.8 is not a size rule. It is a &lt;strong&gt;spacing rule with a size floor&lt;/strong&gt;, and the spacing half is a Euclidean distance test that most audits do not actually compute.&lt;/p&gt;

&lt;p&gt;I measured it. Everything below is from a single machine, in a single Chrome build, and the limitations are at the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the criterion actually says
&lt;/h2&gt;

&lt;p&gt;WCAG 2.2, &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html" rel="noopener noreferrer"&gt;SC 2.5.8 Target Size (Minimum)&lt;/a&gt;, Level AA:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The target's bounding box is at least &lt;strong&gt;24 by 24 CSS pixels&lt;/strong&gt;, &lt;strong&gt;or&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;Spacing exception&lt;/strong&gt; applies: an imaginary 24 CSS pixel diameter circle centred on the target's bounding box must not intersect another such circle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two circles of diameter 24 do not intersect when and only when their centres are at least 24 apart. So the exception is a centre-to-centre distance test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;passes = (w &amp;gt;= 24 &amp;amp;&amp;amp; h &amp;gt;= 24) || min(centreDistance(target, other)) &amp;gt;= 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are four more exceptions — Inline, User agent control, Equivalent and Essential — and automated tooling cannot evaluate any of them. That matters for how you read your own numbers.&lt;/p&gt;

&lt;p&gt;For completeness: SC 2.5.5 Target Size (Enhanced) is the AAA criterion at 44 by 44 CSS pixels, and the platform guidance people quote alongside it is 44×44 &lt;em&gt;points&lt;/em&gt; on iOS and 48×48 &lt;em&gt;dp&lt;/em&gt; on Android. Those are different units on different coordinate systems; they are not the same measurement as a CSS pixel audit.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured
&lt;/h2&gt;

&lt;p&gt;Playwright driving the system Chrome build (157), viewport 390 × 844 CSS px, &lt;code&gt;deviceScaleFactor: 2&lt;/code&gt;, &lt;code&gt;isMobile&lt;/code&gt;, &lt;code&gt;hasTouch&lt;/code&gt;. Two independent methods for the hit-area question, because they can disagree and only one of them is the thing users experience:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;document.elementFromPoint(x, y)&lt;/code&gt; walked outward from the reported box. Only the element itself or a descendant counts as owned — counting an ancestor would report the parent &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; as the link's hit area, which was my first bug.&lt;/li&gt;
&lt;li&gt;A real activation test: attach a &lt;code&gt;click&lt;/code&gt; listener, &lt;code&gt;page.mouse.click(x, y)&lt;/code&gt; at a known offset, and check whether the handler fired.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The two agreed at every offset tested. That is worth saying, because method 1 alone is a claim about hit-testing and method 2 is a claim about behaviour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 1: the layout box is not the hit area, and most fixes change the box
&lt;/h2&gt;

&lt;p&gt;A 16px inline link and a 14px button, each styled a different way, measured as layout box vs real hit region:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Markup&lt;/th&gt;
&lt;th&gt;Layout box&lt;/th&gt;
&lt;th&gt;Measured hit area&lt;/th&gt;
&lt;th&gt;Clears 24?&lt;/th&gt;
&lt;th&gt;Clears 44?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;bare inline link, 16px&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;no&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+ &lt;code&gt;padding: 12px 16px&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;92.2 × 45&lt;/td&gt;
&lt;td&gt;92.2 × 45&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;display:inline-block&lt;/code&gt; + same padding&lt;/td&gt;
&lt;td&gt;92.2 × 45&lt;/td&gt;
&lt;td&gt;92.2 × 45&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;line-height: 2.5&lt;/code&gt; on the link&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;no&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;line-height: 2.5&lt;/code&gt; on the parent block&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;no&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;inline-block; min-height: 24px&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;60.2 × 24&lt;/td&gt;
&lt;td&gt;60.2 × 24&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;transparent &lt;code&gt;::after&lt;/code&gt;, &lt;code&gt;inset: -8px&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;73.2 × 36&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;same &lt;code&gt;::after&lt;/code&gt; with &lt;code&gt;pointer-events: none&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;60.2 × 21&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;no&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;button &lt;code&gt;padding: 4px 8px&lt;/code&gt;, 14px&lt;/td&gt;
&lt;td&gt;52.7 × 28&lt;/td&gt;
&lt;td&gt;52.7 × 28&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;button &lt;code&gt;padding: 5px 12px&lt;/code&gt;, 14px&lt;/td&gt;
&lt;td&gt;60.7 × 30&lt;/td&gt;
&lt;td&gt;60.7 × 30&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;button &lt;code&gt;min-height/min-width: 44px&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;64.7 × 44&lt;/td&gt;
&lt;td&gt;64.7 × 44&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A bare 16px text link is &lt;strong&gt;21 CSS pixels tall&lt;/strong&gt;. It fails the floor by 3 pixels without anyone doing anything wrong. That is the whole bug for most sites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 2: &lt;code&gt;line-height&lt;/code&gt; does not make a link easier to hit
&lt;/h2&gt;

&lt;p&gt;This is the one I expected to be wrong about. Giving the link &lt;code&gt;line-height: 2.5&lt;/code&gt; computes to a 40px line box and the containing paragraph really does grow to 40px. But the link's box stayed &lt;strong&gt;50.2 × 21&lt;/strong&gt;, and the activation window did not move:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;Link box&lt;/th&gt;
&lt;th&gt;Click activates at vertical offsets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;default line-height&lt;/td&gt;
&lt;td&gt;50.2 × 21&lt;/td&gt;
&lt;td&gt;−8, −4, 0, +4, +8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;line-height: 2.5&lt;/code&gt; on the link&lt;/td&gt;
&lt;td&gt;50.2 × 21&lt;/td&gt;
&lt;td&gt;−8, −4, 0, +4, +8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;line-height: 2.5&lt;/code&gt; on the parent&lt;/td&gt;
&lt;td&gt;50.2 × 21&lt;/td&gt;
&lt;td&gt;−8, −4, 0, +4, +8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;padding: 12px 16px&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;82.2 × 45&lt;/td&gt;
&lt;td&gt;−16 … +16 (every offset tested)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;transparent &lt;code&gt;::after&lt;/code&gt;, &lt;code&gt;inset: -8px&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;50.2 × 21&lt;/td&gt;
&lt;td&gt;−16 … +16 (every offset tested)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At −12 and −16 the paragraph owns the point and the link does not fire, with or without the extra line-height.&lt;/p&gt;

&lt;p&gt;The nuance that makes this worth knowing: &lt;code&gt;line-height&lt;/code&gt; still &lt;em&gt;helps&lt;/em&gt;, just not the way the advice implies. It does not grow the target. It grows the distance between the centres of adjacent lines — and centre distance is exactly what the Spacing exception measures. So &lt;code&gt;line-height&lt;/code&gt; is a spacing fix wearing a size-fix costume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 3: the pseudo-element is the only fix that changes nothing else
&lt;/h2&gt;

&lt;p&gt;Look at the last row of that table. &lt;code&gt;::after&lt;/code&gt; with &lt;code&gt;inset: -8px&lt;/code&gt; leaves the layout box at 50.2 × 21 — the text does not move, the paragraph does not reflow, the visual design is pixel-identical — and yet clicks that land 16px above or below the visible link activate it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.inline-link&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.inline-link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nt"&gt;after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;inset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;-8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="cm"&gt;/* grows the hit region, not the box */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add &lt;code&gt;pointer-events: none&lt;/code&gt; to that pseudo-element and the benefit disappears completely — measured hit area returns to 60.2 × 21. The overlay has to be hit-testable; it is the pseudo-element being struck that counts, not the anchor's box.&lt;/p&gt;

&lt;p&gt;This is the fix for links inside running prose, where padding would break the line. It is also the one that automated size audits miss, because &lt;code&gt;getBoundingClientRect()&lt;/code&gt; still reports 21px.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 4: the vertical stack is where real menus fail
&lt;/h2&gt;

&lt;p&gt;Horizontal rows of words almost always pass, because the links are wide and their centres are far apart. Stacked menus and footer lists are the failure case. Five 13px links, &lt;code&gt;line-height: 1.2&lt;/code&gt;, measured line box &lt;strong&gt;15.594px&lt;/strong&gt;, in a flex column at increasing &lt;code&gt;gap&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;gap&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Pair centre distances&lt;/th&gt;
&lt;th&gt;Links failing AA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;15.72 – 17.41&lt;/td&gt;
&lt;td&gt;5 of 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;19.69 – 21.07&lt;/td&gt;
&lt;td&gt;5 of 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;21.68 – 22.94&lt;/td&gt;
&lt;td&gt;5 of 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;23.74 – 24.86&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2 of 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;25.67 – 26.74&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;27.66 – 28.66&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The vertical delta is just &lt;code&gt;line box + gap&lt;/code&gt;, so 15.6 + 8 = 23.6 — under 24. What rescues three of the five pairs is the &lt;strong&gt;horizontal&lt;/strong&gt; offset: "Home" and "Services" have different widths, so their centres differ in x, and the Euclidean distance is larger than the vertical one. At &lt;code&gt;gap: 8&lt;/code&gt; the four pairs land between 23.74 and 24.86, straddling the pass line, and two links still fail.&lt;/p&gt;

&lt;p&gt;I re-ran each variant across 10 independent page loads. The failing counts did not change between runs, so the spread above is variation &lt;em&gt;between pairs on one page&lt;/em&gt;, not measurement noise. &lt;code&gt;gap: 8&lt;/code&gt; is not a passing value that sometimes reads as failing; it is a value that sits on the boundary and fails the tightest pair.&lt;/p&gt;

&lt;p&gt;The padding route is cleaner and has a sharper cliff. Same list, &lt;code&gt;display: block&lt;/code&gt;, padding instead of gap:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Padding&lt;/th&gt;
&lt;th&gt;Link height&lt;/th&gt;
&lt;th&gt;Centre distance&lt;/th&gt;
&lt;th&gt;Links failing AA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;4px 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;23.594&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;23.594&lt;/td&gt;
&lt;td&gt;5 of 5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;6px 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;27.594&lt;/td&gt;
&lt;td&gt;27.594&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;8px 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;31.594&lt;/td&gt;
&lt;td&gt;31.594&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;12px 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;39.594&lt;/td&gt;
&lt;td&gt;39.594&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;padding: 4px 0&lt;/code&gt; on 13px type gives you a target &lt;strong&gt;0.406 CSS pixels&lt;/strong&gt; short of the minimum. It fails the size floor and it fails the spacing test with the same number, so the exception cannot save it. Six pixels clears both at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 5: auditing our own site
&lt;/h2&gt;

&lt;p&gt;I ran the same measurement against the live Design Den Solutions site at 390 × 844.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Page&lt;/th&gt;
&lt;th&gt;Targets measured&lt;/th&gt;
&lt;th&gt;Under 24px&lt;/th&gt;
&lt;th&gt;AA failures&lt;/th&gt;
&lt;th&gt;AAA failures&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;home&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;web-development&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;contact&lt;/td&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Median target area 16,104 px². The mobile nav links render at 366 × 44, the social and menu buttons at 48 × 48. Every target that fell under 24px was rescued by the Spacing exception:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"See all web projects →" 168.3 × 21, nearest centre 172px&lt;/li&gt;
&lt;li&gt;"mobile app development" 187.8 × 19, nearest 219.9px&lt;/li&gt;
&lt;li&gt;footer "&lt;a href="mailto:info@designdensolutions.com"&gt;info@designdensolutions.com&lt;/a&gt;" 219.4 × 19, nearest 57.4px&lt;/li&gt;
&lt;li&gt;footer "+91 98721 90965" 116.6 × 19, nearest 57.4px&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am not going to present that as a clean bill of health. Four targets pass only because nothing else happens to be near them, and the audit does not evaluate the Inline exception — two of those four sit inside running text, where the Inline exception is the correct defence and the spacing arithmetic is beside the point. A passing score from an incomplete evaluator is a starting position, not a conclusion.&lt;/p&gt;

&lt;h2&gt;
  
  
  The snippet
&lt;/h2&gt;

&lt;p&gt;This is what I ran. Paste it into DevTools on any page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tapAudit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'a[href],button,input:not([type=hidden]),select,textarea,[role=button],[role=link],summary'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scrollX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scrollY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;boxes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;cs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;display&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;cs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;visibility&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'hidden'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBoundingClientRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sx&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sy&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;boxes&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;others&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boxes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;nearest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;others&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;
        &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;others&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cx&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cy&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;Infinity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tooSmall&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'aria-label'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tagName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${b.w.toFixed(1)} x ${b.h.toFixed(1)}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;tooSmall&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;nearestCentre&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isFinite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nearest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;nearest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="no"&gt;FAILS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tooSmall&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;nearest&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;FAILS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;tapAudit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns only targets that fail the size floor &lt;strong&gt;and&lt;/strong&gt; the spacing test, which is the correct conjunction. Three things it will get wrong, on purpose:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It measures the whole document, not the visible viewport — content below the fold is included, which is what you want for an audit but is not what "what the user sees" means.&lt;/li&gt;
&lt;li&gt;It skips anything hidden with &lt;code&gt;display: none&lt;/code&gt;, &lt;code&gt;visibility: hidden&lt;/code&gt; or &lt;code&gt;opacity: 0&lt;/code&gt;, but an off-canvas panel that is merely translated or clipped still reports its targets.&lt;/li&gt;
&lt;li&gt;It ignores the Inline, Equivalent, User agent control and Essential exceptions, so a reported failure may still conform.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two bugs I hit writing it, both of which produce confident wrong answers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rounding before the distance maths.&lt;/strong&gt; I rounded widths to one decimal, then computed centres from the rounded values. That moved a 23.74px pair across the line and reported three failing links where the answer is two. Round when you print, never when you compare.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treating the spacing test as vertical.&lt;/strong&gt; &lt;code&gt;Math.hypot&lt;/code&gt; over both axes is what the circles do. Using only &lt;code&gt;dy&lt;/code&gt; fails a horizontal row of wide links that actually passes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I'd do with this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Do not size to 24.&lt;/strong&gt; The floor is where the argument starts, not where it ends. Every value in the tables above that sits near 24 needed a second measurement to interpret.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;padding: 6px 0&lt;/code&gt; on 13px stacked links&lt;/strong&gt; is the smallest change that clears both halves of the test outright. Four pixels does not, by 0.406px.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the &lt;code&gt;::after&lt;/code&gt; overlay for links inside prose&lt;/strong&gt;, where padding would reflow the line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test at the CSS pixel level, not the visual level.&lt;/strong&gt; Nothing in the 50.2 × 21 result is visible in a screenshot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report failures as pairs, not elements.&lt;/strong&gt; "Two of five links fail" is a different fix from "the menu fails".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;p&gt;One machine, one Chrome build (157), one viewport (390 × 844 CSS px). The lab pages are synthetic and the live audit is of the site as served today, which is not the same as the working copy in the repository. &lt;code&gt;elementFromPoint&lt;/code&gt; is viewport-bound, so hit-area probing only happens in the fixed-layout pages. The Fitts' law index of difficulty — &lt;code&gt;ID = log2(1 + D/W)&lt;/code&gt;, at a 120px travel distance giving 3.09 bits for a 16px target against 1.90 for a 44px target, i.e. 1.63× the pointing difficulty — is a geometric model of task difficulty. It is not a human-subject study, and I ran no user testing and claim no mistap rate. Anyone telling you a percentage of taps that miss is making a different claim than the one the data supports.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Prepared with AI assistance and reviewed for accuracy by Design Den Solutions. The cover image is a conceptual AI illustration, not a screenshot. Measurements are this article's own, from the harness described above.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Design Den Solutions builds mobile-first, responsive sites and does the UI/UX and wireframing before the code, including cross-device testing — &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=tap_target_spacing" rel="noopener noreferrer"&gt;see what that covers on the web development page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Font Loading Is a Layout Decision: Measured Shift for swap, optional, fallback and block</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Thu, 12 Nov 2026 19:35:33 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/font-loading-is-a-layout-decision-measured-shift-for-swap-optional-fallback-and-block-5e8h</link>
      <guid>https://dev.to/designden_solutions_89070/font-loading-is-a-layout-decision-measured-shift-for-swap-optional-fallback-and-block-5e8h</guid>
      <description>&lt;p&gt;Most advice about &lt;code&gt;font-display&lt;/code&gt; stops at "use &lt;code&gt;swap&lt;/code&gt; unless you can't stand the flash". That framing is wrong in two ways. First, &lt;code&gt;swap&lt;/code&gt; is not a single behaviour — it is a three-phase timing contract, and what your page does depends on where the font lands inside those phases. Second, the layout shift it causes is not just "text gets slightly wider". On a page that sizes anything in &lt;code&gt;ch&lt;/code&gt;, the swap changes the &lt;em&gt;width of the container itself&lt;/em&gt;, which changes the line count, which moves everything below it.&lt;/p&gt;

&lt;p&gt;I built a small harness to measure this rather than argue about it. Everything below is a number I actually got out of it, with the limits stated at the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;One page, one viewport (1366×768), Chromium (system Chrome, driven by Playwright), served over &lt;code&gt;http://127.0.0.1&lt;/code&gt; so the font request can be genuinely intercepted and delayed. Three &lt;code&gt;@font-face&lt;/code&gt; rules for Plus Jakarta Sans 400/600/700 — the font the Design Den site actually loads — and a fallback stack identical to the one in that site's &lt;code&gt;index.html&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nt"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;--font&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Plus Jakarta Sans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system-ui&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;-apple-system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Segoe UI"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Roboto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The page is a hero: a display heading on &lt;code&gt;clamp(3rem, 7vw, 7rem)&lt;/code&gt; with &lt;code&gt;line-height: .92&lt;/code&gt;, a lede paragraph at &lt;code&gt;font-size: 19px; max-width: 52ch&lt;/code&gt;, and a pill button underneath. The font response is delayed by 1200 ms to simulate a cold fetch on a real network.&lt;/p&gt;

&lt;p&gt;That &lt;code&gt;52ch&lt;/code&gt; is the whole story, and almost nobody notices it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mechanism people miss: &lt;code&gt;ch&lt;/code&gt; re-resolves when the font swaps
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ch&lt;/code&gt; is defined as the advance measure of the "0" glyph &lt;strong&gt;in the element's current font&lt;/strong&gt;. So &lt;code&gt;max-width: 52ch&lt;/code&gt; is not a fixed width. It is a width that is recomputed the moment the used font changes.&lt;/p&gt;

&lt;p&gt;Sampled geometry from the harness, same page, same viewport, nothing else touching it:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Moment&lt;/th&gt;
&lt;th&gt;Used font&lt;/th&gt;
&lt;th&gt;
&lt;code&gt;52ch&lt;/code&gt; resolves to&lt;/th&gt;
&lt;th&gt;Lede height&lt;/th&gt;
&lt;th&gt;Button top&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;t = 70 ms (fallback render)&lt;/td&gt;
&lt;td&gt;system-ui → Segoe UI&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;533 px&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;88 px (3 lines)&lt;/td&gt;
&lt;td&gt;456 px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;t = 1270 ms (after swap)&lt;/td&gt;
&lt;td&gt;Plus Jakarta Sans&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;723 px&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;59 px (2 lines)&lt;/td&gt;
&lt;td&gt;427 px&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The paragraph got &lt;strong&gt;190 px wider — a 35.6 % jump in the column&lt;/strong&gt; — not because the text grew, but because the "0" glyph in Plus Jakarta Sans is much wider than the "0" in Segoe UI. A wider column fit the same sentence in two lines instead of three. The document height went from 673 px to 644 px and the button moved up 29 px.&lt;/p&gt;

&lt;p&gt;So the visible symptom is not "the text wobbles". It is "a paragraph changes its own width and everything under it slides". On a real page with a hero image, a sticky nav offset, or a &lt;code&gt;min-height: 100vh&lt;/code&gt; section, that same reflow can push content across a fold.&lt;/p&gt;

&lt;p&gt;For reference, the advance-width probe on a 68-character sample string at &lt;code&gt;700 112px&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fallback (system-ui → Segoe UI): &lt;strong&gt;3716.51 px&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Plus Jakarta Sans: &lt;strong&gt;3885.39 px&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;the webfont is &lt;strong&gt;4.54 % wider&lt;/strong&gt; on that string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 4.5 % width difference sounds trivial. Through &lt;code&gt;ch&lt;/code&gt;, it became a 35.6 % container difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  CLS per strategy, repeated three times
&lt;/h2&gt;

&lt;p&gt;The only thing that moves on this page is the button, and it moves only because the lede reflows at the swap — so every layout-shift entry is attributable to the font swap. Each row below is 3 identical repeat runs.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;font-display&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Font arrives at 1200 ms&lt;/th&gt;
&lt;th&gt;CLS&lt;/th&gt;
&lt;th&gt;Final &lt;code&gt;52ch&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;swap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;0.00083&lt;/td&gt;
&lt;td&gt;723 px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fallback&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;0.00083&lt;/td&gt;
&lt;td&gt;723 px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;block&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;0.00026&lt;/td&gt;
&lt;td&gt;723 px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;&lt;code&gt;optional&lt;/code&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;no — font never used for this load&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;533 px&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;swap&lt;/code&gt; + &lt;code&gt;size-adjust/ascent/descent: 96%&lt;/code&gt;, &lt;code&gt;line-gap: 0%&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.00779&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;694 px&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All values were stable across the repeats — the same configuration gave the identical CLS three times. One earlier single-run sample of &lt;code&gt;fallback&lt;/code&gt; reported 0.00581; the repeat run reported 0.00083, and I am quoting the repeat.&lt;/p&gt;

&lt;h3&gt;
  
  
  What &lt;code&gt;optional&lt;/code&gt; is actually doing here
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;display: optional&lt;/code&gt; gives you a ~100 ms block period and a &lt;strong&gt;zero-length swap period&lt;/strong&gt;. If the font is not available when the text is first laid out, the browser uses the fallback for the entire document lifetime and only considers the webfont on a later navigation.&lt;/p&gt;

&lt;p&gt;That is why CLS is exactly zero and why the lede stayed at 533 px: the webfont never rendered at all on that load. &lt;code&gt;optional&lt;/code&gt; does not fix the shift. It &lt;strong&gt;declines the font&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is a legitimate engineering choice, and it is the one the Design Den homepage makes. Its markup is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"preconnect"&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.googleapis.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"preconnect"&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.gstatic.com"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Optional fonts avoid a late typography swap; generated local CSS is inlined for first paint. --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&amp;amp;display=optional"&lt;/span&gt;
      &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;media&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"print"&lt;/span&gt; &lt;span class="na"&gt;onload&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"this.media='all'"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;media="print"&lt;/code&gt; with an &lt;code&gt;onload&lt;/code&gt; promotion to &lt;code&gt;all&lt;/code&gt; keeps the Google Fonts stylesheet out of the critical path, and &lt;code&gt;display=optional&lt;/code&gt; keeps the swap from happening mid-session. The cost is real and should be said out loud: &lt;strong&gt;on a first visit over a slow connection, a large part of your audience never sees your brand typeface.&lt;/strong&gt; They see Segoe UI, or Roboto, or whatever the platform hands back. Your carefully chosen display face is a repeat-visit reward.&lt;/p&gt;

&lt;p&gt;If brand typography is load-bearing for you — a studio, a fashion label, a luxury brand — &lt;code&gt;optional&lt;/code&gt; may be the wrong trade. If legibility and stability are load-bearing — a form, a booking flow, a legal site — it is a strong one. Decide it deliberately instead of inheriting &lt;code&gt;swap&lt;/code&gt; from a boilerplate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Metric overrides made it worse, not better
&lt;/h3&gt;

&lt;p&gt;The standard advice is to measure the fallback's metrics and apply &lt;code&gt;size-adjust&lt;/code&gt;, &lt;code&gt;ascent-override&lt;/code&gt;, &lt;code&gt;descent-override&lt;/code&gt; and &lt;code&gt;line-gap-override&lt;/code&gt; so the webfont occupies the same space. In this harness, applying a plausible-looking flat 96 % to all of them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@font-face&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'PJS'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;url&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/fonts/pjs-700.woff2'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;size-adjust&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;ascent-override&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;descent-override&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;line-gap-override&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;…moved the final column width &lt;em&gt;closer&lt;/em&gt; to the fallback (694 px instead of 723 px, against 533 px), which is the intended direction — and &lt;strong&gt;increased CLS from 0.00083 to 0.00779, roughly nine times worse.&lt;/strong&gt; The overrides changed the box metrics, not only the advance width, so they altered how many lines the paragraph needed &lt;em&gt;and&lt;/em&gt; where things sat, producing additional shift entries.&lt;/p&gt;

&lt;p&gt;I am not claiming overrides are bad. I am claiming that a copied percentage is a guess, and that a guess here made the metric you are trying to protect go up. Compute the values against your actual fallback font on your actual target platforms, then measure. If you cannot measure, do not ship them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The naming trap: &lt;code&gt;text-size-adjust&lt;/code&gt; is not &lt;code&gt;size-adjust&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;While checking this, I found four matches for "size-adjust" in the Design Den CSS — and all four were &lt;code&gt;text-size-adjust: 100%&lt;/code&gt; in &lt;code&gt;responsive.css&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-text-size-adjust&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-size-adjust&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="kt"&gt;%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a completely different property. &lt;code&gt;text-size-adjust&lt;/code&gt; stops &lt;strong&gt;mobile browsers from inflating font sizes&lt;/strong&gt; when they think text is too small to read. &lt;code&gt;size-adjust&lt;/code&gt; scales &lt;strong&gt;one font face's metrics&lt;/strong&gt;. Having one in your CSS does not mean you have addressed font swap, and searching your codebase for one finds the other. Worth knowing before you tell yourself this is already handled.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to measure it yourself
&lt;/h2&gt;

&lt;p&gt;Two things that cost me time:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Do not trust &lt;code&gt;document.fonts.check()&lt;/code&gt; for "was the font used".&lt;/strong&gt; In this harness it returned &lt;code&gt;true&lt;/code&gt; for &lt;code&gt;display: optional&lt;/code&gt; runs where the font demonstrably never rendered. The reliable signal is geometry: measure the rendered width of a &lt;code&gt;ch&lt;/code&gt;-sized element, or the document height, and compare against the known fallback value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. &lt;code&gt;layout-shift&lt;/code&gt; entries are silently not delivered in some automation configurations.&lt;/strong&gt; My first harness reported CLS &lt;code&gt;0&lt;/code&gt; for &lt;em&gt;every&lt;/em&gt; strategy, which looked like a clean result and was completely false. The cause was navigating with &lt;code&gt;waitUntil: 'commit'&lt;/code&gt;. The same page, same observer, same mutation reported shifts correctly under &lt;code&gt;waitUntil: 'load'&lt;/code&gt;. A zero you cannot explain is not a measurement — run a deliberate control shift (insert a 200 px block and confirm the observer fires) before you believe any CLS number coming out of a script.&lt;/p&gt;

&lt;p&gt;The observer itself is short:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;cls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PerformanceObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getEntries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hadRecentInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cls&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'layout-shift'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buffered&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;buffered: true&lt;/code&gt; matters, or you miss the entries that happened before your script ran.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would decide before choosing a font
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pick the &lt;code&gt;font-display&lt;/code&gt; behaviour as a brand decision, not a default.&lt;/strong&gt; &lt;code&gt;optional&lt;/code&gt; buys stability and costs first-visit brand type. &lt;code&gt;swap&lt;/code&gt; buys the typeface and costs a reflow. Both are defensible; an unexamined one is not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop sizing layout boxes in &lt;code&gt;ch&lt;/code&gt; if you are swapping fonts.&lt;/strong&gt; &lt;code&gt;max-width: 65ch&lt;/code&gt; is a nice readable-measure heuristic, but it makes your layout depend on a glyph metric that changes during load. Use &lt;code&gt;rem&lt;/code&gt; or a &lt;code&gt;clamp()&lt;/code&gt; with a px ceiling for anything whose width affects line count below the fold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reserve the space, then measure the reserve.&lt;/strong&gt; The fix for font shift is the same fix for image shift: give the container a height that does not depend on which font won.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat metric overrides as an optimisation with a verification step&lt;/strong&gt;, not a checklist item.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preconnect to the font origin.&lt;/strong&gt; It is one line and it moves the arrival time, which is the variable every strategy keys off.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Limits of this experiment
&lt;/h2&gt;

&lt;p&gt;One machine, one viewport, one Windows fallback (Segoe UI), one font pair, one paragraph, no CPU throttling, no real network RTT — the delay was injected, not measured. These numbers rank strategies on this page; they do not describe your site or anyone's field data, and I would not quote them as a Core Web Vitals prediction. The &lt;code&gt;ch&lt;/code&gt; mechanism, the &lt;code&gt;optional&lt;/code&gt; behaviour and the override result are the parts I would generalise. The absolute CLS values are the parts you should re-measure.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: this article was drafted with AI assistance and reviewed for accuracy by Design Den; the accompanying cover is a conceptual AI-generated 3D illustration with the official Design Den Solutions logo composited unchanged, not a screenshot of any real page. All figures come from the harness described above.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Design Den Solutions builds and maintains responsive websites in Mohali / Chandigarh with performance basics, semantic structure and load-time checks handled as part of the build rather than bolted on afterwards — details on the &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=font_swap_layout_shift" rel="noopener noreferrer"&gt;web design and development service page&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Empty States Are Application Logic, Not a Blank Panel With an Illustration</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Wed, 11 Nov 2026 20:13:35 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/empty-states-are-application-logic-not-a-blank-panel-with-an-illustration-32nl</link>
      <guid>https://dev.to/designden_solutions_89070/empty-states-are-application-logic-not-a-blank-panel-with-an-illustration-32nl</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F750cjivq8tas0y4vmc7s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F750cjivq8tas0y4vmc7s.png" alt="Orange, black and white 3D editorial illustration of a web dashboard and smartphone with empty content trays and an illuminated route towards an action button. A Design Den Solutions panel carries the headline AN EMPTY SCREEN NEEDS A NEXT STEP, with the official logo, +91 98721 90965 and www.designdensolutions.com." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of empty-state bugs begin with one convenient assumption: an empty array means there is nothing to show.&lt;/p&gt;

&lt;p&gt;It does not. An empty array might be a new account, a search with no matches, a response that has not arrived, or a request that failed. If those conditions share one UI, the application will eventually tell the user something false.&lt;/p&gt;

&lt;p&gt;The most damaging example is rendering “No enquiries yet” after a failed request. That copy describes the customer’s data. The application only knows that it could not retrieve the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model the state before styling it
&lt;/h2&gt;

&lt;p&gt;For a small service catalogue, a pure function can make the distinctions explicit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'loading'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'loading'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Loading services'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'error'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'error'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'We couldn’t load your services'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Check your connection and try again. Your filters have been kept.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'retry'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${items.length} services`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'no-results'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`No services match “${query.trim()}”`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Try a different word or clear the search to see every service.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'clear-search'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'first-use'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'No services yet'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Add your first service to start building your catalogue.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'add-service'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ordering matters. Loading and failure are resolved before the code looks at &lt;code&gt;items.length&lt;/code&gt;. A failed request cannot accidentally fall through to the first-use message. A non-empty query turns a successful empty result into &lt;code&gt;no-results&lt;/code&gt;, not &lt;code&gt;first-use&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In a larger application, this can be a reducer, a state machine or a framework-specific view model. The important part is that the distinction lives in application logic rather than being inferred inside a template.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the decision table, not just the component snapshot
&lt;/h2&gt;

&lt;p&gt;The pure function gives us a small test surface. These checks were executed with Node’s &lt;code&gt;assert/strict&lt;/code&gt; before publication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'loading'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'loading'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'error'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'logo'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'retry'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'logo'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'no-results'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'logo'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'clear-search'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'first-use'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'add-service'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'logo'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'No services match “logo”'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS: loading, error, success, no-results, first-use, actions and query copy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The whitespace-only query case is deliberate. Without &lt;code&gt;trim()&lt;/code&gt;, a space can turn a first-use view into a no-results view with an apparently blank search term.&lt;/p&gt;

&lt;h2&gt;
  
  
  Render user text without creating an HTML injection path
&lt;/h2&gt;

&lt;p&gt;The query belongs in text, not in an HTML string. Using &lt;code&gt;innerHTML&lt;/code&gt; for &lt;code&gt;No services match “${query}”&lt;/code&gt; would make the search field an injection source. DOM APIs keep the content and the markup separate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;panel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#services-panel'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;statusMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#services-status'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;actionLabels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;retry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Try again'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'clear-search'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Clear search'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'add-service'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Add service'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceChildren&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;heading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'h2'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'p'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'button'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'button'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;actionLabels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;panel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;statusMessage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'loading'&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The accompanying HTML can contain one persistent status element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"services-status"&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"status"&lt;/span&gt; &lt;span class="na"&gt;aria-atomic&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"services-panel"&lt;/span&gt; &lt;span class="na"&gt;aria-label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Services"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MDN’s &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/status_role" rel="noopener noreferrer"&gt;&lt;code&gt;status&lt;/code&gt; role documentation&lt;/a&gt; notes that &lt;code&gt;status&lt;/code&gt; has an implicit &lt;code&gt;aria-live="polite"&lt;/code&gt;. It is intended for advisory information that does not receive focus. Keep the status element separate from the interactive panel; replacing a large live region containing headings, buttons and lists can create noisy repeated announcements.&lt;/p&gt;

&lt;p&gt;A status announcement does not replace visible copy, keyboard access or sensible focus management. If activating “Clear search” moves the user back to a populated list, decide whether focus should remain on the search field or move to the results heading. Do not move it unexpectedly on every background update.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserve context when a request fails
&lt;/h2&gt;

&lt;p&gt;A retry should not erase the user’s query. The request path also needs to handle non-2xx responses explicitly; &lt;code&gt;fetch()&lt;/code&gt; does not reject merely because the server returned HTTP 404 or 500. MDN’s &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" rel="noopener noreferrer"&gt;Using Fetch guide&lt;/a&gt; documents that behaviour.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;loadServices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'loading'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/api/services'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`HTTP ${response.status}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#service-search'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;viewFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'error'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#service-search'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This short example is intentionally not a complete data layer. Production code should also protect against stale responses: if request A starts, request B starts later, and B finishes first, A must not overwrite B’s newer state. An &lt;code&gt;AbortController&lt;/code&gt;, a request sequence number, or the framework’s cancellation mechanism can enforce that boundary.&lt;/p&gt;

&lt;p&gt;The same rule applies to actions. “Retry” should repeat the failed operation with the current context. “Clear search” should clear the search, not every saved filter. “Add service” should only appear for users who hold that permission.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test failure without deleting real data
&lt;/h2&gt;

&lt;p&gt;A useful test matrix includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a new test account with zero records;&lt;/li&gt;
&lt;li&gt;a populated account with a no-match query;&lt;/li&gt;
&lt;li&gt;a delayed response so loading is observable;&lt;/li&gt;
&lt;li&gt;HTTP error responses and malformed JSON;&lt;/li&gt;
&lt;li&gt;an offline transition;&lt;/li&gt;
&lt;li&gt;a slow earlier response arriving after a newer response;&lt;/li&gt;
&lt;li&gt;a read-only user who cannot perform the primary action;&lt;/li&gt;
&lt;li&gt;keyboard-only navigation and a screen-reader pass;&lt;/li&gt;
&lt;li&gt;long copy, enlarged text and a narrow viewport.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use fixtures, mocks or a controlled test environment. Do not delete production records to make an empty state appear.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design handoff is part of the implementation
&lt;/h2&gt;

&lt;p&gt;For each dynamic view, specify the trigger, exact copy, available action, permission requirement, preserved input, focus destination and live-region behaviour. A polished success-state mockup plus a decorative empty-state illustration is not enough to implement from.&lt;/p&gt;

&lt;p&gt;Empty states are where the interface explains uncertainty. Treat them as states in the application, with tested transitions and truthful copy, rather than as blank panels waiting for artwork.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Prepared with AI assistance and reviewed for accuracy by Design Den Solutions. The cover is a conceptual AI-generated illustration with the official company logo composited unchanged. The state-model assertions above were executed locally before publication.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Design Den Solutions plans and builds browser-based products, portals and dashboards. See &lt;a href="https://www.designdensolutions.com/app-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=empty_state_next_step" rel="noopener noreferrer"&gt;app and web product development&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>ux</category>
    </item>
    <item>
      <title>Five Users Is a Stop Rule, Not a Sample Size</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Tue, 10 Nov 2026 21:03:37 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/five-users-is-a-stop-rule-not-a-sample-size-14m4</link>
      <guid>https://dev.to/designden_solutions_89070/five-users-is-a-stop-rule-not-a-sample-size-14m4</guid>
      <description>&lt;p&gt;Every front-end team has inherited some version of this: "we don't need real usability data, Nielsen said five users is enough." The recommendation is real. The way it gets quoted into standups is not. Five users is a &lt;strong&gt;stopping rule for problem discovery&lt;/strong&gt;. It is not a sample size for anything you want to measure, and the difference is arithmetic you can implement in about twenty lines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9wq0e5xyodb9j1p54fns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9wq0e5xyodb9j1p54fns.png" alt="Orange, black and white 3D editorial illustration of five stylised figures seated at a desk observing a website interface panel while a translucent orange funnel collects observation chips above it. A Design Den Solutions panel carries the headline 'FIVE USERS IS A BUDGET NOT A PROOF' and the line 'Five testers find most of the problems. They prove nothing', with the official Design Den Solutions logo, +91 98721 90965 and www.designdensolutions.com shown." width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Conceptual AI-generated cover for this article, composited with the unchanged official Design Den Solutions logo. The logo artwork itself is not AI-generated.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The model behind the number
&lt;/h2&gt;

&lt;p&gt;Jakob Nielsen's original claim (&lt;a href="https://www.nngroup.com/articles/why-you-only-need-to-test-with-5-users/" rel="noopener noreferrer"&gt;&lt;em&gt;Why You Only Need to Test with 5 Users&lt;/em&gt;, NN/g, 18 March 2000&lt;/a&gt;) is a coverage model, not a headcount heuristic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P(n) = 1 - (1 - L)^n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;n&lt;/code&gt; = testers in the round&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;L&lt;/code&gt; = the proportion of the &lt;em&gt;total&lt;/em&gt; problem set that one tester finds&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;P&lt;/code&gt; = cumulative proportion of the problem set found after &lt;code&gt;n&lt;/code&gt; testers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nielsen used &lt;code&gt;L = 0.31&lt;/code&gt;, which lands at ~85% at &lt;code&gt;n = 5&lt;/code&gt;. He was explicit that this is a cost/benefit stopping point, not a completeness claim: "The best results come from testing no more than 5 users," and in the same article, "You need to test with at least 15 users to discover all the usability problems." His 2012 restatement (&lt;a href="https://www.nngroup.com/articles/how-many-test-users/" rel="noopener noreferrer"&gt;&lt;em&gt;How Many Test Users in a Usability Study?&lt;/em&gt;&lt;/a&gt;) keeps "test 5 users in a qualitative usability study" and gives the reason not to inflate &lt;code&gt;n&lt;/code&gt;: "ROI drops like a stone with a bigger N."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;coverage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;coverage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sb"&gt;`n=${n}  total=${(coverage(0.31, n) * 100).toFixed(1)}%  `&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
    &lt;span class="sb"&gt;`this tester adds ${((coverage(0.31, n) - prev) * 100).toFixed(1)} pts`&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// n=1 total=31.0% this tester adds 31.0 pts&lt;/span&gt;
&lt;span class="c1"&gt;// n=3 total=67.1% this tester adds 14.8 pts&lt;/span&gt;
&lt;span class="c1"&gt;// n=5 total=84.4% this tester adds  7.0 pts&lt;/span&gt;
&lt;span class="c1"&gt;// n=8 total=94.9% this tester adds  2.3 pts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That marginal column is the entire argument. Tester five returns roughly a fifth of tester one's yield. The model assumes &lt;strong&gt;equal findability&lt;/strong&gt; across problems, which is false in practice: a label nobody clicks is nearly invisible to every tester, while a broken button is found by the first person who touches it. So &lt;code&gt;L&lt;/code&gt; is not measurable before the round, and 85% is a planning figure, not a guarantee. At &lt;code&gt;L = 0.20&lt;/code&gt;, five testers cover 67.2%; at &lt;code&gt;L = 0.15&lt;/code&gt;, 55.6%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implement the stop rule, not the magic number
&lt;/h2&gt;

&lt;p&gt;The useful engineering artefact is a uniqueness curve over the problems you have actually logged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;shouldStop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;problemLog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;testersNeeded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;firstSeen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;problemLog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;firstSeen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;firstSeen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;newPerTester&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;problemLog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firstSeen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;newPerTester&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;testersNeeded&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;newPerTester&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tail&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;every&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`last ${testersNeeded} testers surfaced ${tail.reduce((a, b) =&amp;gt; a + b, 0)} new problem classes`&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Stop" is not "five reached". It is "the last two testers produced no problem class you had not already recorded". On a checkout flow with one obvious blocker, that can happen at three. On a genuinely untested dashboard, it may not happen until seven. Five is the &lt;em&gt;expected&lt;/em&gt; cost of a round, not the exit condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  What five people cannot tell you
&lt;/h2&gt;

&lt;p&gt;This is where teams write a number into a deck that the data cannot carry.&lt;/p&gt;

&lt;p&gt;Three of five testers abandon the enquiry form. Someone reports "60% of users fail the form". Five is not a survey; the correct statement is an interval.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;wilson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.96&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;wilson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// [0.23, 0.88]  -&amp;gt; "23% to 88%"&lt;/span&gt;
&lt;span class="nf"&gt;wilson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// [0.39, 0.78]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A 65-point-wide interval is not a conversion finding. To hold ±10 points around a 60% success rate you need &lt;code&gt;n = z²p(1−p)/e² ≈ 93&lt;/code&gt;. If the goal is a &lt;strong&gt;rate&lt;/strong&gt; — task success, completion time, benchmark against a competitor — that is a quantitative study with a different budget, and no amount of qualitative rounds substitutes for it.&lt;/p&gt;

&lt;p&gt;Two more things five users will not do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prove the redesign worked.&lt;/strong&gt; Before/after on five people each is anecdote with a delta.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Establish accessibility conformance.&lt;/strong&gt; WCAG is a standard you audit against, not a headcount. Contrast under &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html" rel="noopener noreferrer"&gt;SC 1.4.3&lt;/a&gt; is 4.5:1 for normal text and 3:1 for large text, computed from relative luminance. Five sighted testers will not tell you whether your orange-on-white passes, and neither will fifty.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And one that is easy to get wrong: five per &lt;em&gt;study&lt;/em&gt; is not five per &lt;em&gt;audience&lt;/em&gt;. The NN/g guidance is "you'll need close to 5 users per group". Split across two personas, each group gets 2.5 people and the model's single-population assumption no longer applies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rounds beat bigger N
&lt;/h2&gt;

&lt;p&gt;A second round of five after the fixes is not a repeat of the first. It runs against a changed interface, so it can surface problems the first round structurally could not reach — the flow you just unblocked, the copy you just rewrote, the regression you just shipped. One round of ten would find 97.6% of the problems that existed &lt;em&gt;at the start&lt;/em&gt;, and 0% of the ones created by your fixes. Iteration is the point; Nielsen's own phrasing is to "plan for a lot of iterations".&lt;/p&gt;

&lt;h2&gt;
  
  
  Make each session produce a bug, not a vibe
&lt;/h2&gt;

&lt;p&gt;Instrument the same fields every time so the round aggregates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"task"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"find out whether installation is included"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"tester"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"T3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"completed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"helpRequested"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"timeOnTaskSec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;143&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"firstClick"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;".pricing-card"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"quote"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"I can't tell if they fit it or just sell it"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"problemIds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"pricing-scope-ambiguous"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"severity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"serious"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Severity rubric that survives review: &lt;strong&gt;blocker&lt;/strong&gt; = cannot complete without help; &lt;strong&gt;serious&lt;/strong&gt; = completes with visible struggle or a wrong assumption; &lt;strong&gt;cosmetic&lt;/strong&gt; = preference, no task impact. Then write the finding the way you would write a defect: task, page or selector, observed action, user's stated goal, consequence. &lt;code&gt;pricing-scope-ambiguous&lt;/code&gt; with two testers and a quote is actionable. "Users find pricing confusing" is not.&lt;/p&gt;

&lt;p&gt;Two operational constraints worth putting in the test script before you invite anyone:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consent and data.&lt;/strong&gt; Record only with explicit consent, store the minimum, and never let a tester enter real personal data, make a payment, or fire a live enquiry into your own production system. Use a staging environment or stop at the boundary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recruit for the actual population.&lt;/strong&gt; Colleagues share your mental model and will silently repair your copy for you. Five strangers beat five teammates every time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The honest summary
&lt;/h2&gt;

&lt;p&gt;Five users is the cheapest round that reliably produces a ranked fix list, because the marginal yield collapses right after it. Use it to decide &lt;em&gt;what to build next&lt;/em&gt;. Do not use it to report a percentage, to certify accessibility, or to claim a lift. Those are different studies, and the arithmetic above will tell you the sample size you actually need before you promise anyone a number.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nielsen, J. &lt;em&gt;Why You Only Need to Test with 5 Users.&lt;/em&gt; Nielsen Norman Group, 18 Mar 2000.&lt;/li&gt;
&lt;li&gt;Nielsen, J. &lt;em&gt;How Many Test Users in a Usability Study?&lt;/em&gt; Nielsen Norman Group, 3 Jun 2012.&lt;/li&gt;
&lt;li&gt;W3C, &lt;em&gt;Understanding SC 1.4.3 Contrast (Minimum)&lt;/em&gt;, WCAG 2.2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Disclosure: this article was prepared with AI assistance and reviewed for accuracy by Design Den Solutions. The cover image is a conceptual AI-generated illustration with the official company logo composited unchanged. All percentages come from the discovery model and the code shown above, which was executed before publishing; no client data or user metrics are represented.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Design Den Solutions builds and reviews websites and apps for businesses in Mohali and the Tricity — &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=five_user_test_budget" rel="noopener noreferrer"&gt;web development and UI/UX services&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>ux</category>
      <category>frontend</category>
      <category>analytics</category>
    </item>
    <item>
      <title>A Logo Has to Survive Six Render Sizes. Most Handoffs Only Test One.</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Mon, 09 Nov 2026 20:52:05 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/a-logo-has-to-survive-six-render-sizes-most-handoffs-only-test-one-2hc1</link>
      <guid>https://dev.to/designden_solutions_89070/a-logo-has-to-survive-six-render-sizes-most-handoffs-only-test-one-2hc1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5xdzb76hvcf3krllgwhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5xdzb76hvcf3krllgwhk.png" alt="Orange, black and white 3D editorial illustration of one abstract logo mark repeated on six raised panels shrinking from large to small, carrying the official Design Den Solutions logo, the number +91 98721 90965 and www.designdensolutions.com" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every brand handoff I have inherited arrived as a mark plus a folder of exports. Nobody had tested the mark at the sizes it actually gets rendered at, so the first person to need it small solved it by cropping the PNG.&lt;/p&gt;

&lt;p&gt;Here is the number that makes this a front-end problem rather than a print problem: a browser tab paints your favicon at roughly &lt;strong&gt;16×16 CSS pixels&lt;/strong&gt;, and on a 2× display that is a 32-pixel asset being asked to carry a wordmark. Google's favicon guidance asks for an image &lt;strong&gt;larger than 48×48&lt;/strong&gt; so it can be reused across surfaces, and it accepts BMP, GIF, ICO, PNG, JPEG, PPM and TIFF. So the asset you ship is bigger than the asset that gets seen — and the difference between those two is where logos die.&lt;/p&gt;

&lt;h2&gt;
  
  
  The six sizes, and what each one breaks
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Surface&lt;/th&gt;
&lt;th&gt;Typical render&lt;/th&gt;
&lt;th&gt;What fails&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Browser tab&lt;/td&gt;
&lt;td&gt;~16 px CSS&lt;/td&gt;
&lt;td&gt;wordmarks, thin strokes, closed counters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App icon&lt;/td&gt;
&lt;td&gt;120–180 px, squircle&lt;/td&gt;
&lt;td&gt;art that touches its bounding box&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Social avatar&lt;/td&gt;
&lt;td&gt;40–80 px, circular crop&lt;/td&gt;
&lt;td&gt;anything relying on corners or a baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One-colour print&lt;/td&gt;
&lt;td&gt;10–40 mm&lt;/td&gt;
&lt;td&gt;gradients, two-colour overlaps, hairlines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large format&lt;/td&gt;
&lt;td&gt;metres, viewed at distance&lt;/td&gt;
&lt;td&gt;loose letter-spacing, low-weight marks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Email/PDF header&lt;/td&gt;
&lt;td&gt;96 dpi, re-compressed&lt;/td&gt;
&lt;td&gt;anti-aliasing halos, sub-pixel positioning&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The useful observation is that the failure modes are different. Shrinking breaks &lt;em&gt;detail&lt;/em&gt;. Cropping breaks &lt;em&gt;composition&lt;/em&gt;. One-colour breaks &lt;em&gt;relationships between shapes&lt;/em&gt;. Distance breaks &lt;em&gt;weight&lt;/em&gt;. A single export cannot fix four different problems, which is why "send me the logo" is never a well-defined request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ship the icon set, not the logo
&lt;/h2&gt;

&lt;p&gt;For the tab and the home screen, the deliverable is a &lt;strong&gt;simplified mark&lt;/strong&gt;, not the primary lockup. Draw it once at 32 px and keep it as its own asset.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- SVG favicon with an ICO fallback for the clients that need one --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/svg+xml"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/icons/mark.svg"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/png"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"32x32"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/icons/mark-32.png"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"icon"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/png"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"48x48"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/icons/mark-48.png"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"apple-touch-icon"&lt;/span&gt; &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"180x180"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/icons/apple-touch-icon-180.png"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Serve &lt;code&gt;mark.svg&lt;/code&gt; with the right type, and note that SVG favicons are not universal — the PNG sizes above are not belt-and-braces, they are the path that older and non-Chromium engines actually take.&lt;/p&gt;

&lt;p&gt;For installability and home-screen icons, the manifest is where the size ladder becomes explicit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Design Den Solutions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"short_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Design Den"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"icons"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/icons/mark-192.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"192x192"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/icons/mark-512.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"512x512"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/icons/mark-512-maskable.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"512x512"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"purpose"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"maskable"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;maskable&lt;/code&gt; matters more than people expect. A maskable icon is composited into a shape the &lt;em&gt;platform&lt;/em&gt; chooses, so the artwork has to be built with a safe zone rather than scaled into one. Adaptive icons on Android use a 108dp canvas where only the central 72dp is guaranteed visible — which means roughly a third of the canvas width is bleed. If the mark fills the artboard, it gets cut.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two rules that stop the drift
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Measure clear space off a feature inside the artwork, not off the artboard.&lt;/strong&gt; Artboard padding vanishes the moment anything crops to content bounds — image CDNs, social platforms, PDF exporters. A rule like "clear space equals the cap height of the wordmark" travels with the drawing because it is defined in the drawing's own units.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Draw the one-colour version; do not desaturate it.&lt;/strong&gt; Where two shapes overlap, one colour has to resolve that overlap deliberately: knock it out, outline it, or separate the shapes. A desaturated two-tone mark keeps the overlap as a muddy third value, and that value is what turns into a blob at 16 px or in a single thread colour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The accessibility exemption that gets over-read
&lt;/h2&gt;

&lt;p&gt;WCAG 2.2 SC 1.4.11 (Non-text Contrast) requires 3:1 for the graphical objects needed to identify user interface components and their states. Its exception list includes logotypes: text that is part of a logo or brand name has no minimum contrast requirement.&lt;/p&gt;

&lt;p&gt;That exemption is about conformance, not visibility. It exists because a logo is a fixed identity asset rather than a control a user has to operate. It does not mean the mark is legible on your shopboard at dusk, or that it survives one-colour print, or that the wordmark is readable at the size your invoice header renders it. If you assert the exemption in a review, assert it for the right object — the logotype, not the icon button that happens to contain it. An icon used as a control is still a user interface component and still needs its 3:1.&lt;/p&gt;

&lt;h2&gt;
  
  
  A test you can actually run in CI
&lt;/h2&gt;

&lt;p&gt;You cannot automate taste, but you can automate the shrink and look at the result. A cheap way to catch regressions is to render the mark at the sizes that break it and fail the build when the asset is missing or when a raster export is smaller than its slot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// icons.test.mjs — run after the icon build step&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vitest&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sharp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;REQUIRED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dist/icons/mark-32.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dist/icons/mark-48.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dist/icons/apple-touch-icon-180.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dist/icons/mark-512-maskable.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;512&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;size&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;REQUIRED&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; exists at &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;x&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add one visual check that a human actually reads. Generate the contact sheet yourself instead of trusting a design-tool zoom level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sharp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sizes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;composites&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src/mark.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;fit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#fff&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;png&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toBuffer&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="na"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}))&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;240&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;channels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#111&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;composite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;composites&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;png&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contact-sheet.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;contact-sheet.png&lt;/code&gt; at 100% zoom on the smallest screen you actually ship to. That is the squint test, and it takes about ninety seconds. It catches more bad logos than any style guide page ever written.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to ask for at handover
&lt;/h2&gt;

&lt;p&gt;One sheet: the mark at each of the six real sizes, the simplified variant used for the smallest ones, the one-colour and inverted versions, the clear-space rule stated in the artwork's own units, and a "do not reproduce smaller than" figure for screen and for print.&lt;/p&gt;

&lt;p&gt;If you want the icon pipeline, the manifest and the contact sheet built as part of the design work rather than retrofitted after launch, that is the kind of front end we specify and ship: &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=logo_scale_test" rel="noopener noreferrer"&gt;website development work at Design Den Solutions&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: this article was prepared with AI assistance and reviewed for technical accuracy by Design Den Solutions. The cover image is a conceptual AI-generated illustration with the official company logo composited unchanged. Google's favicon size and format guidance and the WCAG 2.2 SC 1.4.11 logotype exception were checked against the primary sources at the time of writing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>designsystem</category>
      <category>frontend</category>
      <category>a11y</category>
      <category>css</category>
    </item>
    <item>
      <title>Contrast Is a Pair, Not a Property</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Mon, 09 Nov 2026 20:28:11 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/contrast-is-a-pair-not-a-property-155e</link>
      <guid>https://dev.to/designden_solutions_89070/contrast-is-a-pair-not-a-property-155e</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjpmu1pl222tipuxr861d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjpmu1pl222tipuxr861d.png" alt="Orange, black and white 3D editorial illustration of a brand colour swatch board beside a table of measured contrast pairs, carrying the Design Den Solutions logo, the number +91 98721 90965 and www.designdensolutions.com" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every brand palette I have inherited from a handoff arrived as a list of single colours. A hex, a name, a swatch card, sometimes a note saying "primary". Then the first sprint ships an orange button with a white label, someone opens the site on a budget Android phone in daylight, and the report comes back as a rendering bug.&lt;/p&gt;

&lt;p&gt;It is not a rendering bug. It is the predictable result of treating contrast as a property of a colour, when contrast only ever exists between two colours. &lt;code&gt;#FF5A00&lt;/code&gt; has no contrast value. It has a luminance. The number that decides whether anyone can read your interface is created at the moment you place one colour on top of another.&lt;/p&gt;

&lt;p&gt;That reframing changes what you deliver at the end of a brand or design project. The useful artefact is not a palette board. It is a pairing table.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the standard actually asks for
&lt;/h2&gt;

&lt;p&gt;WCAG 2.2 sets the floor most teams are measured against, and the thresholds are short enough to memorise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SC 1.4.3 Contrast (Minimum), Level AA&lt;/strong&gt; — text and images of text need &lt;strong&gt;4.5:1&lt;/strong&gt;. Large text needs &lt;strong&gt;3:1&lt;/strong&gt;, where "large" means at least 18pt (~24px) regular, or at least 14pt (~18.5px) bold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SC 1.4.6 Contrast (Enhanced), Level AAA&lt;/strong&gt; — 7:1 for normal text, 4.5:1 for large text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SC 1.4.11 Non-text Contrast, Level AA&lt;/strong&gt; — &lt;strong&gt;3:1&lt;/strong&gt; for the visual information needed to identify user interface components and their states, against the colours adjacent to them. Logotype-style marks and decorative graphics are excluded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SC 1.4.1 Use of Colour&lt;/strong&gt; — colour cannot be the only signal you use. A red border on an invalid field with no icon or message still fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sources: &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html" rel="noopener noreferrer"&gt;Understanding Contrast (Minimum)&lt;/a&gt;, &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html" rel="noopener noreferrer"&gt;Understanding Non-text Contrast&lt;/a&gt;, &lt;a href="https://www.w3.org/TR/WCAG22/" rel="noopener noreferrer"&gt;WCAG 2.2 recommendation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is the worked example on our own brand colour, which is the argument in one line. Design Den Solutions uses an orange close to &lt;code&gt;#FF5A00&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Foreground&lt;/th&gt;
&lt;th&gt;Background&lt;/th&gt;
&lt;th&gt;Ratio&lt;/th&gt;
&lt;th&gt;Body text AA&lt;/th&gt;
&lt;th&gt;Large text AA&lt;/th&gt;
&lt;th&gt;Non-text AA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;#FF5A00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FFFFFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;3.13&lt;/td&gt;
&lt;td&gt;fail&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;#FFFFFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FF5A00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;3.13&lt;/td&gt;
&lt;td&gt;fail&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;#0F0F0F&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FF5A00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;6.13&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;#B34700&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FFFFFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5.50&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;#8A4000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FFFFFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;7.46&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;#0F0F0F&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FFFFFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;19.17&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same orange is simultaneously a legal heading colour on white, an illegal body-copy colour on white, and a fine component border on white. Three verdicts, one swatch. This is exactly why a swatch list cannot be an accessibility deliverable.&lt;/p&gt;

&lt;p&gt;It also explains a very common UI decision that gets made by taste and argued about forever: an orange primary button with white text is the version that fails at body size. Orange with near-black text passes at 6.13:1. Nobody had to change the brand to fix it. They had to stop putting white on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compute it, do not eyeball it
&lt;/h2&gt;

&lt;p&gt;The maths is roughly twenty lines and belongs in your tooling rather than in someone's memory. Contrast comes from relative luminance, which needs the gamma-encoded sRGB channels linearised first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toLinear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;channel&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.04045&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;12.92&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mf"&gt;2.4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;luminance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="mf"&gt;0.2126&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;toLinear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.7152&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;toLinear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.0722&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;toLinear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toRgb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;full&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;full&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;g&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;full&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;full&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;contrastRatio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foreground&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;luminance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;toRgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foreground&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;luminance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;toRgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;lighter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;darker&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lighter&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;darker&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foreground&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;large&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ratio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;contrastRatio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foreground&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ratio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;AA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ratio&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;large&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;AAA&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ratio&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;large&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mf"&gt;4.5&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two implementation notes that cause more confusion than the maths:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Always round the ratio last.&lt;/strong&gt; &lt;code&gt;3.13:1&lt;/code&gt; passes nothing at body size, but a tool that reports &lt;code&gt;3.1&lt;/code&gt; and a reviewer who remembers "the large-text number is 3" will happily approve it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alpha has to be flattened first.&lt;/strong&gt; &lt;code&gt;rgba(255, 255, 255, 0.7)&lt;/code&gt; over &lt;code&gt;#FF5A00&lt;/code&gt; is a different colour than either input. Composite, then measure. Any checker that silently ignores alpha will over-report passes on overlays.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The pairs nobody writes down
&lt;/h2&gt;

&lt;p&gt;When you only audit "text colour on background colour", you pass review and still ship an unreadable product. The list below has been the source of most real defects I have had to unwind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disabled controls.&lt;/strong&gt; WCAG exempts inactive components from 1.4.3, so a 50%-opacity grey label is technically legal. It is also the same visual as an enabled label that merely looks quiet. If a state can be mistaken for another state, the fix is a second signal (SC 1.4.1), not a bigger ratio.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Placeholder text.&lt;/strong&gt; Placeholders get styled in the lightest grey in the system, which is usually the pair closest to the 4.5 boundary. A &lt;code&gt;#767676&lt;/code&gt; placeholder on white measures 4.54:1 and clears AA by the width of a rounding error; the "helpful" &lt;code&gt;#999999&lt;/code&gt; most frameworks default to does not. Placeholders are not labels either, so treat the placeholder pair as decorative and give the field a real visible label.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Focus indicators.&lt;/strong&gt; A 2px brand-orange ring on white is 3.13:1 — it clears the 3:1 non-text bar, but only just, and any &lt;code&gt;opacity&lt;/code&gt;, &lt;code&gt;box-shadow&lt;/code&gt; blur or overlapping element pushes it below. Check the ring against the surface it actually sits on, which is often the input's own background rather than the page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Icon strokes and hairline rules.&lt;/strong&gt; Non-text contrast applies to the graphical object you need in order to understand the control. A 1px &lt;code&gt;#CCCCCC&lt;/code&gt; divider between two form sections is invisible on a low-quality panel, and invisible is worse than ugly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hover and active.&lt;/strong&gt; Contrast is about the state being legible; users also need to see that the state &lt;em&gt;changed&lt;/em&gt;. Verify the before/after pair against each other, not only against the page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dark mode.&lt;/strong&gt; Inverting a light palette is not a dark theme. A saturated brand hue that carries text on white will visually vibrate against near-black, and it usually loses to a desaturated, lightened step of the same hue. This is why the scale matters more than the hero swatch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turn one hue into a scale that survives
&lt;/h2&gt;

&lt;p&gt;Instead of approving three colours, approve a ladder of steps for each hue and record which steps are text-safe on each surface. Starting from the same orange:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Token&lt;/th&gt;
&lt;th&gt;Hex&lt;/th&gt;
&lt;th&gt;On white&lt;/th&gt;
&lt;th&gt;Verdict for body text&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;brand-500&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FF5A00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;3.13&lt;/td&gt;
&lt;td&gt;display, headings, large labels only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;brand-600&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#CC5200&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;4.40&lt;/td&gt;
&lt;td&gt;still fails, do not use for copy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;brand-700&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#B34700&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5.50&lt;/td&gt;
&lt;td&gt;AA text on white&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;brand-800&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#8A4000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;7.46&lt;/td&gt;
&lt;td&gt;AAA text on white&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Encode the intent so the next developer does not have to remember the table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;color-scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;light&lt;/span&gt; &lt;span class="n"&gt;dark&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--brand-500&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;#ff5a00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* graphics, headings &amp;gt;= 24px, component fills */&lt;/span&gt;
  &lt;span class="py"&gt;--brand-700&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;#b34700&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* AA body text on light surfaces */&lt;/span&gt;
  &lt;span class="py"&gt;--brand-800&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;#8a4000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* AAA body text on light surfaces */&lt;/span&gt;
  &lt;span class="py"&gt;--ink-900&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;#0f0f0f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--surface-0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.btn-primary&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--brand-500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--ink-900&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;      &lt;span class="c"&gt;/* 6.13:1 */&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--brand-700&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c"&gt;/* state edge vs white: 5.50:1 */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.btn-link&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="l"&gt;--brand-700&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    &lt;span class="c"&gt;/* 5.50:1 — readable inline link */&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;underline&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* SC 1.4.1: colour is not the only cue */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then assert it in CI rather than in a code review comment. A tiny test that walks an allowed-pairs list fails the build when someone edits a token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ALLOWED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--ink-900&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--surface-0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--brand-700&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--surface-0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--brand-800&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--surface-0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One honest caveat about the platform: in &lt;code&gt;forced-colors&lt;/code&gt; mode the browser replaces your palette with the user's system colours on purpose. Do not build anything whose meaning depends on your specific orange surviving. Test with forced colors enabled and confirm the layout and labels still make sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Text over photography has no fixed answer
&lt;/h2&gt;

&lt;p&gt;A hero image is the case where a pairing table can go wrong, because the background is a range. Two workable approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Put a scrim behind the copy — a solid panel, or a gradient whose darkest stop is the value you actually measured. Measure the ratio against the &lt;strong&gt;composited&lt;/strong&gt; result, not the hex in your stylesheet.&lt;/li&gt;
&lt;li&gt;Sample the image's average luminance at render time and switch between a light and dark text token. This is the approach worth automating on user-generated imagery, where you cannot control the source.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What does not work is a fixed &lt;code&gt;#FFFFFF&lt;/code&gt; label with a &lt;code&gt;text-shadow&lt;/code&gt; and a shrug. Shadows are not contrast guarantees, and they are the first thing to disappear when a thumbnail is rendered small and compressed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ship the pairing table with the files
&lt;/h2&gt;

&lt;p&gt;A brand handoff that contains only swatches pushes every downstream decision onto people who were not in the room. Add one page to the handoff: every approved foreground/background pair, its measured ratio, the minimum size it is valid at, the components it covers and a review date. When a new surface appears, the question stops being "does this orange feel right here?" and becomes "is this row in the table?"&lt;/p&gt;

&lt;p&gt;If you want the accessibility checks to be part of the design work rather than an audit after it, this is the kind of readable, documented front end we build — design tokens specified against the standard, tested in CI, and handed over with the pairing table so it survives the next redesign: &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=brand_contrast_pairs" rel="noopener noreferrer"&gt;website development work at Design Den Solutions&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: this article was prepared with AI assistance and reviewed for technical accuracy by Design Den Solutions. The cover image is a conceptual AI-generated illustration with the official company logo composited unchanged. All contrast ratios above were calculated with the WCAG 2.2 relative-luminance formula quoted in this article, and are reproducible from the code sample.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>a11y</category>
      <category>ai</category>
      <category>designsystem</category>
    </item>
    <item>
      <title>Build a Redirect Map Before a Website Redesign</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Tue, 03 Nov 2026 21:00:14 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/build-a-redirect-map-before-a-website-redesign-4bm3</link>
      <guid>https://dev.to/designden_solutions_89070/build-a-redirect-map-before-a-website-redesign-4bm3</guid>
      <description>&lt;p&gt;A website redesign can improve navigation, readability and conversion paths, but it can also break years of accumulated links in one afternoon. The risk is not the new visual design itself. The risk appears when old URLs disappear, change meaning or point visitors to a generic page without a plan.&lt;/p&gt;

&lt;p&gt;A redirect map is the handover document that connects every important old URL to its best new destination. Build it before launch, not after customers and search engines begin finding errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with an inventory of real URLs
&lt;/h2&gt;

&lt;p&gt;Do not create the map from the new sitemap alone. Collect URLs from the existing XML sitemap, analytics landing pages, Search Console landing pages, internal links, campaign links, downloadable files and any high-value external references you know about.&lt;/p&gt;

&lt;p&gt;For each old URL, record:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The current URL and page purpose.&lt;/li&gt;
&lt;li&gt;The most relevant new destination.&lt;/li&gt;
&lt;li&gt;The redirect decision and HTTP status.&lt;/li&gt;
&lt;li&gt;The content owner responsible for approving the match.&lt;/li&gt;
&lt;li&gt;Important internal links that must be updated.&lt;/li&gt;
&lt;li&gt;A post-launch verification result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This inventory often reveals pages that are missing from the redesign brief: old service pages that still receive enquiries, event pages referenced from social profiles, PDFs used by customers, or campaign landing pages linked from third-party websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Match intent, not just keywords
&lt;/h2&gt;

&lt;p&gt;The best redirect preserves the visitor's reason for clicking. An old page about restaurant social-media management should go to the closest current service resource, not automatically to the homepage. A retired event page may need a current events page, an archive, or a clear replacement rather than an unrelated service page.&lt;/p&gt;

&lt;p&gt;Use four practical decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep:&lt;/strong&gt; The URL and purpose remain valid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redirect:&lt;/strong&gt; A clearly equivalent or better destination exists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consolidate:&lt;/strong&gt; Several overlapping pages become one stronger resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retire:&lt;/strong&gt; No useful replacement exists; return an honest response instead of creating a misleading redirect.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid sending every removed URL to the homepage. That hides the real information gap, creates a poor customer journey and makes verification harder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the correct response
&lt;/h2&gt;

&lt;p&gt;A permanent move normally uses a server-side &lt;code&gt;301&lt;/code&gt; redirect. A genuinely temporary move may use &lt;code&gt;302&lt;/code&gt; or &lt;code&gt;307&lt;/code&gt;, depending on the application and method-preservation requirements. Do not use a client-side script or delayed meta refresh when the server or hosting layer can return the intended redirect directly.&lt;/p&gt;

&lt;p&gt;Developers should also prevent redirect chains. If &lt;code&gt;/old-service&lt;/code&gt; redirects to &lt;code&gt;/services&lt;/code&gt;, and &lt;code&gt;/services&lt;/code&gt; then redirects to &lt;code&gt;/services/social-media&lt;/code&gt;, update the first rule to point directly to the final URL.&lt;/p&gt;

&lt;p&gt;Example redirect map entry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Old: /social-media-packages
New: /social-media.html
Status: 301
Owner: Marketing
Reason: Current equivalent service page
Verified: final response 200, one hop, CTA works
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The syntax used to implement the rule will depend on the server, framework, CDN or hosting platform. The mapping decision should remain independent of that syntax so it can be reviewed by both content and development teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update internal links at the source
&lt;/h2&gt;

&lt;p&gt;A redirect is a safety net, not a substitute for maintenance. Update navigation, body links, buttons, canonical tags, structured data, XML sitemaps and campaign templates to use the final URLs directly.&lt;/p&gt;

&lt;p&gt;Check business-profile links, social profile links, video descriptions and frequently reused campaign templates as well. These sources can continue sending visitors through old routes long after the redesign launches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the complete path before launch
&lt;/h2&gt;

&lt;p&gt;For every priority mapping, verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The old URL returns the intended redirect status.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Location&lt;/code&gt; header points to the correct final destination.&lt;/li&gt;
&lt;li&gt;The path reaches the destination in one hop where practical.&lt;/li&gt;
&lt;li&gt;The final page returns &lt;code&gt;200&lt;/code&gt;, is indexable when intended and uses the correct canonical URL.&lt;/li&gt;
&lt;li&gt;The page still satisfies the original visitor intent.&lt;/li&gt;
&lt;li&gt;Important calls to action, forms, phone links and downloads work on mobile.&lt;/li&gt;
&lt;li&gt;Analytics and conversion measurement remain present where configured.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test a representative sample in the staging environment, then retest the full priority list immediately after launch. Keep the map as evidence rather than deleting it when the launch is complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Monitor the first weeks after launch
&lt;/h2&gt;

&lt;p&gt;Watch for unexpected &lt;code&gt;404&lt;/code&gt; responses, landing-page drops, new redirect chains and referral traffic reaching obsolete URLs. Search Console and analytics data can help identify missed routes, but they should complement server logs and crawl checks rather than replace them.&lt;/p&gt;

&lt;p&gt;Prioritise fixes by business impact: broken enquiry paths and high-value landing pages come before low-use archive URLs. Record every correction in the redirect map so the live configuration and the handover document stay aligned.&lt;/p&gt;

&lt;h2&gt;
  
  
  A useful redesign handover
&lt;/h2&gt;

&lt;p&gt;A redesign is not complete when the new homepage looks finished. It is complete when customers, search engines, campaigns and external references can still reach the right information.&lt;/p&gt;

&lt;p&gt;Design Den Solutions plans maintainable website journeys as part of its &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=redirect_map_redesign" rel="noopener noreferrer"&gt;web development services&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Prepared with AI assistance and reviewed for usefulness and technical accuracy by Design Den Solutions. The accompanying visual is a conceptual AI-generated illustration; the official Design Den Solutions logo is composited unchanged.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Treat Content Expiry as Data, Not a Calendar Reminder</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Tue, 03 Nov 2026 11:28:02 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/treat-content-expiry-as-data-not-a-calendar-reminder-40ge</link>
      <guid>https://dev.to/designden_solutions_89070/treat-content-expiry-as-data-not-a-calendar-reminder-40ge</guid>
      <description>&lt;p&gt;A campaign can end while its content keeps circulating. A pinned post may point to an expired form, a pricing card may outlive its terms, or an old landing page can remain the destination for a current CTA.&lt;/p&gt;

&lt;p&gt;For developers and content teams, the reliable fix is to store review and expiry decisions as data rather than relying on memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model the lifecycle explicitly
&lt;/h2&gt;

&lt;p&gt;A small content record can carry the information needed for a review queue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/campaigns/spring-offer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"owner"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"marketing"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"publishedAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-03"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"reviewAfter"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-11-10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"expiryAction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"redirect"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"replacement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/services/social-media"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The exact schema is less important than making ownership, timing, and the next action explicit. A vague field such as &lt;code&gt;status: active&lt;/code&gt; cannot tell a build process when the page deserves attention.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep review dates separate from expiry dates
&lt;/h2&gt;

&lt;p&gt;A review date asks a person to verify the asset. An expiry date can trigger a defined system action. They are not interchangeable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a short review cycle for event pages, limited offers, booking routes, and regulated information.&lt;/li&gt;
&lt;li&gt;Use a longer cycle for stable educational material.&lt;/li&gt;
&lt;li&gt;Avoid automatically deleting useful pages merely because a date passed. Redirect, archive, unpublish, or update only when that action fits the content and the user journey.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Surface overdue content in the build
&lt;/h2&gt;

&lt;p&gt;A simple check can warn maintainers without blocking every deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;today&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;contentIndex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reviewDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reviewAfter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reviewDate&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;today&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;live&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Review overdue: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; (owner: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;)`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a larger site, send the same data to a CMS dashboard, issue tracker, or scheduled report. The important part is that the warning reaches a named owner and preserves the public URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the destination, not only the content
&lt;/h2&gt;

&lt;p&gt;A review job should request the page as a customer would and verify the complete route:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The public URL returns the intended page.&lt;/li&gt;
&lt;li&gt;The CTA still points to the correct service or form.&lt;/li&gt;
&lt;li&gt;The destination describes the same offer as the source asset.&lt;/li&gt;
&lt;li&gt;Contact details remain accurate and usable on mobile.&lt;/li&gt;
&lt;li&gt;A retired campaign offers a useful current alternative.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;HTTP status alone is not enough. A &lt;code&gt;200 OK&lt;/code&gt; page can still contain an expired promise or a form that no longer reaches the correct team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep an audit trail
&lt;/h2&gt;

&lt;p&gt;Use a small state vocabulary such as &lt;code&gt;live&lt;/code&gt;, &lt;code&gt;review_due&lt;/code&gt;, &lt;code&gt;update_needed&lt;/code&gt;, &lt;code&gt;retired&lt;/code&gt;, and &lt;code&gt;replaced&lt;/code&gt;. Retain the previous URL, the decision, and the replacement destination. That history prevents an outdated asset from being imported again and helps explain redirects later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with one weekly query
&lt;/h2&gt;

&lt;p&gt;Once a week, select items due in the next seven days, open each public asset, test its destination, and record the decision. The system does not need to rewrite everything automatically. Its job is to make stale content visible before it becomes a customer's first impression.&lt;/p&gt;

&lt;p&gt;Design Den Solutions helps teams build maintainable websites and digital campaigns. See our &lt;a href="https://www.designdensolutions.com/social-media.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=content_review_date" rel="noopener noreferrer"&gt;social media management support&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Prepared with AI assistance and reviewed for usefulness and accuracy by Design Den Solutions. The cover is a conceptual AI illustration using the official logo unchanged.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Keyboard Focus Is a Navigation State, Not a Decoration</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Sat, 31 Oct 2026 03:04:29 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/keyboard-focus-is-a-navigation-state-not-a-decoration-fdg</link>
      <guid>https://dev.to/designden_solutions_89070/keyboard-focus-is-a-navigation-state-not-a-decoration-fdg</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flof11vapza3r4n7rk9gw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flof11vapza3r4n7rk9gw.png" alt="Orange and black 3D browser navigation and Tab key illustration with a visible focus ring, the original Design Den Solutions logo, +91 98721 90965 and www.designdensolutions.com." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Prepared with AI assistance for Design Den Solutions. The cover is a conceptual AI illustration; the official company logo was composited unchanged. The examples below are illustrative code, not a claim about a client site.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A navigation menu can be perfectly usable with a mouse and almost impossible with a keyboard. The problem is often small: a design reset removes the browser outline, a sticky header covers the focused link, or a dropdown opens only on hover. Those are interaction failures, not merely cosmetic differences.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with semantic controls
&lt;/h2&gt;

&lt;p&gt;Use links for navigation and buttons for actions. A &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; with a click handler does not gain keyboard activation, focusability or expected semantics merely because it looks like a menu item. A short, ordinary navigation pattern gives the browser useful defaults:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;nav&lt;/span&gt; &lt;span class="na"&gt;aria-label=&lt;/span&gt;&lt;span class="s"&gt;"Primary"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/services/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Services&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/work/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Work&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/contact/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tab should reach each link in a sensible order. Enter should activate it. If a control reveals more options without navigating, make that control a button and expose its expanded state. Avoid inventing a custom keyboard model when ordinary links and buttons already fit the job.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the focused item obvious
&lt;/h2&gt;

&lt;p&gt;The default browser focus indicator is valuable. If a design system replaces it, give users an equally clear state. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:focus-visible&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:focus-visible&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nx"&gt;#ff6b1a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;outline-offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;:focus-visible&lt;/code&gt; lets the browser decide when a focus indicator is appropriate for the current interaction. It commonly appears during keyboard navigation, but the matching rules are browser heuristics, so do not describe it as a keyboard-only switch. The W3C's &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/focus-visible" rel="noopener noreferrer"&gt;Focus Visible explanation&lt;/a&gt; says keyboard-operable interfaces need a mode in which focus is visible. MDN explains that &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/outline-offset" rel="noopener noreferrer"&gt;&lt;code&gt;outline-offset&lt;/code&gt;&lt;/a&gt; creates space between an outline and the element's edge.&lt;/p&gt;

&lt;p&gt;Do not write &lt;code&gt;outline: none&lt;/code&gt; as a broad reset and hope another selector compensates later. Check the rendered state on the actual backgrounds, including dark headers, photos and mobile menu panels. A bright orange ring on white can be clear while the same ring against an orange hero disappears.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the path, not just the CSS rule
&lt;/h2&gt;

&lt;p&gt;Open the page fresh, leave the mouse alone and press Tab. Can you tell where focus starts? Can you reach the menu trigger, open it, reach its options and leave it? Can you return with Shift+Tab? If the menu closes as soon as focus moves into it, a perfect outline does not solve the flow.&lt;/p&gt;

&lt;p&gt;Test at a narrow viewport too. A sticky header can obscure the focused element after the page scrolls. The W3C treats &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum" rel="noopener noreferrer"&gt;Focus Not Obscured (Minimum)&lt;/a&gt; as a separate requirement: the focus indicator and target need to remain perceivable when navigation moves. Check zoom and any fixed cookie banner or chat widget as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep a compact review record
&lt;/h2&gt;

&lt;p&gt;For each important navigation pattern, record the page, viewport, browser, control sequence and observed result. A useful issue is specific: “From the menu button, Tab moves to the first link, but the panel closes and the focus ring is hidden.” That gives the developer a reproducible state to fix. Retest with mouse and touch after changing focus or menu logic so the interaction remains coherent across input methods.&lt;/p&gt;

&lt;p&gt;For teams reviewing a site handover, this keyboard path belongs beside form and mobile checks. Our &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=keyboard_focus_navigation" rel="noopener noreferrer"&gt;website development service&lt;/a&gt; covers practical site builds and handovers; the steps above are useful for any developer auditing a navigation component.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources: &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/focus-visible" rel="noopener noreferrer"&gt;W3C Focus Visible&lt;/a&gt;, &lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum" rel="noopener noreferrer"&gt;W3C Focus Not Obscured&lt;/a&gt;, and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/outline-offset" rel="noopener noreferrer"&gt;MDN outline-offset&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Responsive Images Can Still Shift Your Layout: Reserve the Space First</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Wed, 28 Oct 2026 12:45:10 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/responsive-images-can-still-shift-your-layout-reserve-the-space-first-55ad</link>
      <guid>https://dev.to/designden_solutions_89070/responsive-images-can-still-shift-your-layout-reserve-the-space-first-55ad</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0jvx3qgyqlkh98gclkfx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0jvx3qgyqlkh98gclkfx.png" alt="Editorial illustration showing a reserved image frame in a responsive webpage layout, with Design Den Solutions branding and contact details" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An image can be responsive and still make the page jump. &lt;code&gt;max-width: 100%; height: auto&lt;/code&gt; keeps a large image inside a narrow container, but it does not tell the browser how tall the image will be before the file arrives. If text moves after the image loads, the user may lose their place or tap the wrong control.&lt;/p&gt;

&lt;p&gt;The first fix is usually ordinary HTML. Give the image its intrinsic dimensions and let CSS scale it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"service-team-1200.jpg"&lt;/span&gt;
  &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"1200"&lt;/span&gt;
  &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"675"&lt;/span&gt;
  &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Two team members reviewing a website layout on a laptop"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;article&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; attributes establish a 16:9 ratio, so the browser can reserve the right shape before the image downloads. CSS can still make it fit the available width. Use the real dimensions or at least the real ratio; a fabricated ratio can still cause a shift when the actual file appears. MDN explains the browser's &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img" rel="noopener noreferrer"&gt;intrinsic aspect-ratio behaviour&lt;/a&gt; and the &lt;a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Performance/Multimedia" rel="noopener noreferrer"&gt;layout-shift problem&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make responsive variants keep the same ratio
&lt;/h2&gt;

&lt;p&gt;If the 600-pixel and 1200-pixel files are merely different sizes of the same crop, &lt;code&gt;srcset&lt;/code&gt; can help the browser choose a suitable file without changing the reserved shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"service-team-1200.jpg"&lt;/span&gt;
  &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"service-team-600.jpg 600w, service-team-1200.jpg 1200w"&lt;/span&gt;
  &lt;span class="na"&gt;sizes=&lt;/span&gt;&lt;span class="s"&gt;"(max-width: 700px) 100vw, 700px"&lt;/span&gt;
  &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"1200"&lt;/span&gt;
  &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"675"&lt;/span&gt;
  &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Two team members reviewing a website layout on a laptop"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;sizes&lt;/code&gt; value must describe the &lt;em&gt;rendered width&lt;/em&gt;, not simply copy the file sizes. Test it against the actual layout. If a mobile crop changes the image's aspect ratio, do not assume one pair of dimensions describes both crops. Give the art-directed source its own dimensions or reserve an appropriate aspect ratio in the relevant layout, then test the swap. MDN's &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Responsive_images" rel="noopener noreferrer"&gt;responsive images guide&lt;/a&gt; distinguishes resolution switching from art direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lazy-load selectively
&lt;/h2&gt;

&lt;p&gt;For an image below the first screen, native &lt;code&gt;loading="lazy"&lt;/code&gt; can defer the download until it approaches the viewport. Keep the dimensions even there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"project-detail.jpg"&lt;/span&gt;
  &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"960"&lt;/span&gt;
  &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"640"&lt;/span&gt;
  &lt;span class="na"&gt;loading=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;
  &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Close view of the project navigation design"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not apply lazy loading to every image by habit. An image that is already needed in the initial viewport should usually load promptly; delaying the page's main visual can worsen the experience. MDN notes that &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/Lazy_loading" rel="noopener noreferrer"&gt;lazy-loaded images can appear after the &lt;code&gt;load&lt;/code&gt; event&lt;/a&gt;, and explicitly recommends dimensions for lazy-loaded images. Check real page behaviour rather than relying on an attribute checklist alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep alternative text tied to the image's purpose
&lt;/h2&gt;

&lt;p&gt;Dimensions solve layout stability, not accessibility. The &lt;code&gt;alt&lt;/code&gt; value should communicate the image's function or relevant content in context. A decorative flourish can use an empty &lt;code&gt;alt=""&lt;/code&gt;; a screenshot that teaches a step needs a description of the information the reader should take from it. Avoid repeating the heading or stuffing search terms. If the image contains essential words, make those words available in nearby HTML as well.&lt;/p&gt;

&lt;p&gt;Before shipping, review the page at narrow and wide widths, throttle the network, and watch the space above and below each image while it loads. Check the actual files selected by &lt;code&gt;srcset&lt;/code&gt;, the mobile crop, the alt text, and whether a visible button moves. The goal is a stable reading and interaction path, not a green score divorced from the page.&lt;/p&gt;

&lt;p&gt;For teams building service pages where images, readability and enquiry paths all matter, &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=stable_responsive_images" rel="noopener noreferrer"&gt;Design Den Solutions' website development service&lt;/a&gt; provides the relevant context.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Generated with AI and checked against the linked MDN documentation. The matching conceptual cover illustration was generated with AI; the supplied Design Den Solutions logo was directly composited unchanged. The examples are illustrative, not measurements from a client site.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>performance</category>
      <category>a11y</category>
      <category>seo</category>
    </item>
    <item>
      <title>A Contact Form Needs More Than a Green Success Message</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Tue, 27 Oct 2026 11:53:45 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/a-contact-form-needs-more-than-a-green-success-message-4gpm</link>
      <guid>https://dev.to/designden_solutions_89070/a-contact-form-needs-more-than-a-green-success-message-4gpm</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft18fa37a62tldkowf4ns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft18fa37a62tldkowf4ns.png" alt="Orange and black contact form illustration with a success check, the original Design Den Solutions logo, +91 98721 90965 and www.designdensolutions.com." width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Prepared with AI assistance for Design Den Solutions. The cover is a conceptual AI illustration with the original company logo composited unchanged.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A contact form can look successful while the business receives nothing. The opposite is possible too: the server accepts an enquiry, the browser loses the response, and the person presses Send again. A sound implementation needs states that describe what the application actually knows, not just what the button was clicked to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with a state model
&lt;/h2&gt;

&lt;p&gt;For a simple form, document at least five states: editing, invalid, sending, confirmed, and unconfirmed failure. “Confirmed” should mean the server has accepted and stored the submission according to the agreed response contract. A click event is not proof of delivery. An unconfirmed failure means the browser cannot establish the result; the server may or may not have received it.&lt;/p&gt;

&lt;p&gt;Write the visible message for each state before building the animation. If the request fails or times out, avoid “Your message was not sent” unless you can know that. “We could not confirm delivery. Please try again or use our other contact option” is more honest. Give that other option on the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserve native validation and keyboard behaviour
&lt;/h2&gt;

&lt;p&gt;Use a real &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; and a real submit button. Give every input a visible label and choose appropriate &lt;code&gt;type&lt;/code&gt;, &lt;code&gt;required&lt;/code&gt;, and &lt;code&gt;autocomplete&lt;/code&gt; values. Let the browser run its built-in constraint validation for straightforward fields. If JavaScript needs to initiate submission, &lt;code&gt;requestSubmit()&lt;/code&gt; follows the form's validation and submit-event path; directly calling &lt;code&gt;submit()&lt;/code&gt; bypasses both. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event" rel="noopener noreferrer"&gt;MDN's submit-event explanation&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit" rel="noopener noreferrer"&gt;requestSubmit() reference&lt;/a&gt; make this distinction clear.&lt;/p&gt;

&lt;p&gt;Do not replace helpful field errors with one generic red banner. If you add custom validation, associate the message with the field, identify the error in text, and test it with keyboard and assistive technology. A live status region can announce a changed submission status without moving the user's focus unexpectedly; see &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-live" rel="noopener noreferrer"&gt;MDN's aria-live reference&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the in-flight state explicit
&lt;/h2&gt;

&lt;p&gt;Once the valid submit event starts a request, show “Sending…” and prevent accidental repeated clicks while that request is active. Keep the entered data in place until a confirmed success. A disabled button may be useful during the active request, but the form still needs a readable status message. Restore the control after a failed or unconfirmed attempt.&lt;/p&gt;

&lt;p&gt;A front-end guard reduces rapid duplicate requests from one page instance. It does &lt;strong&gt;not&lt;/strong&gt; guarantee exactly-once processing: people can retry after a refresh, open another tab, or lose the response after the server commits. If duplicate enquiries are costly, design a server-side idempotency mechanism and retention window appropriate to the service. Treat the front-end guard and server-side deduplication as different layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define what the server confirms
&lt;/h2&gt;

&lt;p&gt;Agree on the API response before writing the success copy. Does a successful HTTP response mean the enquiry was durably recorded, merely queued, or handed to another service? Return a stable reference when useful, but do not expose private submission details in the URL or analytics. If an email notification fails after the enquiry is saved, the page may still show a confirmed receipt while the operations team handles the alert internally; this depends on the business workflow.&lt;/p&gt;

&lt;p&gt;Do not fire a lead conversion solely on the click or the “sending” state. Use a genuinely confirmed result and check that the analytics event is configured and received. Count the result once even when a user reloads the confirmation page. This matters more than a decorative success animation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the uncertain cases
&lt;/h2&gt;

&lt;p&gt;The happy path is the easiest test. Also exercise missing required fields, a slow response, a server error, a dropped network connection after submission, a second click, a keyboard submission, and a refresh after a confirmed response. Check the inbox or stored record and the on-page state together. A visible confirmation with no stored enquiry is a defect; two records for one intended enquiry deserve investigation.&lt;/p&gt;

&lt;p&gt;For a small business site, the contact journey also needs a working alternate route and clear expectations about when a person will respond. Our &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=contact_form_states" rel="noopener noreferrer"&gt;website development service&lt;/a&gt; covers practical site builds and handovers; the implementation details above are a checklist for any team reviewing an enquiry form.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cover: conceptual AI illustration; original Design Den Solutions logo composited unchanged. +91 98721 90965 · &lt;a href="http://www.designdensolutions.com" rel="noopener noreferrer"&gt;www.designdensolutions.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>a11y</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Check Canonical URLs Before a Website Launch</title>
      <dc:creator>Design Den Solutions</dc:creator>
      <pubDate>Sat, 24 Oct 2026 22:17:16 +0000</pubDate>
      <link>https://dev.to/designden_solutions_89070/check-canonical-urls-before-a-website-launch-47e8</link>
      <guid>https://dev.to/designden_solutions_89070/check-canonical-urls-before-a-website-launch-47e8</guid>
      <description>&lt;p&gt;Cover description: Orange and black browser cards show a canonical link guiding a page to its production destination. The original Design Den Solutions logo, +91 98721 90965 and &lt;a href="http://www.designdensolutions.com" rel="noopener noreferrer"&gt;www.designdensolutions.com&lt;/a&gt; appear in the cover.&lt;/p&gt;

&lt;p&gt;Prepared with AI assistance for Design Den Solutions. The cover is a conceptual AI illustration with the original company logo composited unchanged.&lt;/p&gt;

&lt;p&gt;A staging build can look ready while still telling search engines that the preferred version of a production page lives on the staging host. This is a small configuration error with a large debugging cost: teams may spend weeks checking indexing reports when the clue was present in the HTML at launch.&lt;/p&gt;

&lt;p&gt;A canonical link is a &lt;strong&gt;preference signal&lt;/strong&gt;, not a command or a promise of ranking. Google can choose a different canonical based on the pages and other signals. The useful pre-launch question is simpler: &lt;em&gt;Does each important production page declare the intended production URL, and do the surrounding signals agree?&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Audit the output, not only the template
&lt;/h2&gt;

&lt;p&gt;For a typical HTML page, inspect the delivered &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"canonical"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.example.com/services/web-development/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An absolute URL makes the host and path explicit. Google's &lt;a href="https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls" rel="noopener noreferrer"&gt;canonical guidance&lt;/a&gt; recommends absolute URLs and a self-referencing canonical on the preferred page. The element belongs in a valid HTML &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;. If JavaScript adds or changes it, compare both source HTML and the rendered page.&lt;/p&gt;

&lt;p&gt;Do the audit against the &lt;strong&gt;built or deployed output&lt;/strong&gt;. A template may be correct while a base URL environment variable, reverse proxy, route generator or CMS setting produces the wrong host in the final response.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small testable checklist
&lt;/h2&gt;

&lt;p&gt;Choose representative URLs: home, a service page, a blog article, a paginated or filtered page if your site uses one, and a URL that redirects. For each, record:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Requested URL and final response URL after redirects.&lt;/li&gt;
&lt;li&gt;HTTP status and whether the page is intended to be public.&lt;/li&gt;
&lt;li&gt;The canonical value in the delivered HTML; check for multiple or conflicting tags.&lt;/li&gt;
&lt;li&gt;Whether that canonical returns an accessible page with the intended content.&lt;/li&gt;
&lt;li&gt;Internal links and XML sitemap entries that point to the preferred URL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a compact Node example for a &lt;strong&gt;known, authorised list of your own public pages&lt;/strong&gt;. It reports the final URL and the canonical in the returned HTML. It is an audit aid, not a crawler or an indexing verdict:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.example.com/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.example.com/services/web-development/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;follow&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canonical&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sr"&gt;/&amp;lt;link&lt;/span&gt;&lt;span class="se"&gt;\b(?=[^&lt;/span&gt;&lt;span class="sr"&gt;&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;\b&lt;/span&gt;&lt;span class="sr"&gt;rel=&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;canonical&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;])(?=[^&lt;/span&gt;&lt;span class="sr"&gt;&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;\b&lt;/span&gt;&lt;span class="sr"&gt;href=&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;]([^&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;)[&lt;/span&gt;&lt;span class="sr"&gt;"'&lt;/span&gt;&lt;span class="se"&gt;])[^&lt;/span&gt;&lt;span class="sr"&gt;&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;*&amp;gt;/i&lt;/span&gt;
  &lt;span class="p"&gt;)?.[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;requested&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;final&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canonical&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For production use, parse HTML with a proper DOM parser instead of depending on an attribute-order regex; the sample deliberately stays small enough to illustrate what to inspect. Also test canonical URLs in HTTP headers if your non-HTML documents use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resolve conflicting signals before asking for indexing
&lt;/h2&gt;

&lt;p&gt;A page that self-canonicalises to the production URL but redirects somewhere else needs investigation. So does a sitemap that lists the staging host, or internal navigation that repeatedly points to a nonpreferred variant. Google notes that redirects, canonical annotations and sitemap inclusion have different strengths; consistent signals help it understand your preference.&lt;/p&gt;

&lt;p&gt;If Search Console later reports a different Google-selected canonical, use &lt;a href="https://developers.google.com/search/docs/crawling-indexing/canonicalization-troubleshooting" rel="noopener noreferrer"&gt;URL Inspection and the canonical troubleshooting guidance&lt;/a&gt; to examine the specific page. Do not treat every “alternate page with proper canonical” as an error. And do not use &lt;code&gt;noindex&lt;/code&gt; merely to force canonical selection among duplicate pages; that can remove the page from Search.&lt;/p&gt;

&lt;p&gt;The handover artifact should be a short table of the checked URL, actual response, declared canonical, intended canonical, and the person responsible for any fix. That makes the release decision reviewable and prevents a generic “SEO checked” sign-off from hiding an unresolved staging URL.&lt;/p&gt;

&lt;p&gt;For teams preparing a site launch, Design Den Solutions offers &lt;a href="https://www.designdensolutions.com/web-development.html?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=canonical_launch_check" rel="noopener noreferrer"&gt;website development and handover support&lt;/a&gt;. The practical takeaway is to test the pages users and crawlers actually receive before the release is considered done.&lt;/p&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>html</category>
    </item>
  </channel>
</rss>
