<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stuart on Medium]]></title>
        <description><![CDATA[Stories by Stuart on Medium]]></description>
        <link>https://medium.com/@sturit?source=rss-0e23c031df1c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LNm7IoqVMnMynFpFTvIOsw.jpeg</url>
            <title>Stories by Stuart on Medium</title>
            <link>https://medium.com/@sturit?source=rss-0e23c031df1c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:33:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sturit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why AI-generated code keeps failing accessibility checks]]></title>
            <link>https://sturit.medium.com/why-ai-generated-code-keeps-failing-accessibility-checks-72942319af81?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/72942319af81</guid>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 07:20:38 GMT</pubDate>
            <atom:updated>2026-07-23T16:05:55.631Z</atom:updated>
            <content:encoded><![CDATA[<h4>And what developers keep missing</h4><figure><img alt="The Claude AI web interface with the message “meet your thinking partner”" src="https://cdn-images-1.medium.com/max/1024/0*sRjHt3KT7hhNqXjc" /><figcaption>Photo by <a href="https://unsplash.com/@planetvolumes?utm_source=medium&amp;utm_medium=referral">Planet Volumes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For six years running, the <a href="https://webaim.org/projects/million/">WebAIM Million report </a>showed web accessibility slowly getting better. Not fast, and not enough, but it was moving in the right direction. The 2026 report broke that streak. <strong>95.9%</strong> of the top one million home pages now have detectable WCAG failures, <strong>up from 94.8%</strong> last year, with an average of <strong>56 errors per page</strong>.</p><p>WebAIM’s own analysis points to a likely cause: the growing reliance on AI-assisted coding. That’s not a coincidence worth glossing over. If you’re shipping components built with an AI tool’s help (and most developers are now) some of that regression is probably sitting in your codebase.</p><p>This isn’t an argument against using AI to write code. It’s a look at why the code it produces so often fails on accessibility, and what you should actually be looking for when you review it.</p><h4>What it looks like in practice</h4><p>Ask an AI tool to build a dropdown menu, a modal, or a “read more” toggle, and you’ll usually get something that works. Click it, and it opens. Visually, it looks ok. Commit it without a proper read-through, and you’ve probably just shipped something a keyboard or screen reader user can’t operate.</p><p>Here’s a fairly typical example: a full modal, generated more or less as-is:</p><pre>&lt;div class=&quot;modal-overlay&quot;&gt;<br>  &lt;div class=&quot;modal&quot;&gt;<br>    &lt;span class=&quot;modal-close&quot; onclick=&quot;closeModal()&quot;&gt;<br>      &amp;times;<br>    &lt;/span&gt;<br>    &lt;div class=&quot;modal-title&quot;&gt;Confirm your subscription&lt;/div&gt;<br>    &lt;div class=&quot;modal-body&quot;&gt;<br>      You&#39;re about to subscribe to our newsletter. Click confirm to continue.<br>    &lt;/div&gt;<br>    &lt;div class=&quot;modal-actions&quot;&gt;<br>      &lt;div class=&quot;btn-confirm&quot; onclick=&quot;confirmSubscription()&quot;&gt;Confirm&lt;/div&gt;<br>      &lt;div class=&quot;btn-cancel&quot; onclick=&quot;closeModal()&quot;&gt;Cancel&lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><pre>function openModal() {<br>  document.querySelector(&#39;.modal-overlay&#39;).style.display = &#39;flex&#39;;<br>}<br><br>function closeModal() {<br>  document.querySelector(&#39;.modal-overlay&#39;).style.display = &#39;none&#39;;<br>}</pre><p>It looks complete. It opens, it closes, the buttons respond to clicks, and a mouse user won’t notice anything wrong. But almost everything here fails the moment you take the mouse away:</p><ul><li><strong>The close button is a </strong>&lt;span&gt;<strong>:</strong> Not focusable, no keyboard event, no role. It doesn&#39;t exist as far as Tab is concerned, and a screen reader announces it as plain text, if it announces it at all.</li><li><strong>Confirm and cancel are </strong>&lt;div&gt;<strong> elements with </strong>onclick<strong>:</strong> Same problem. Neither can be reached or activated by keyboard.</li><li><strong>The modal itself has no role:</strong> No role=&quot;dialog&quot;, no aria-modal=&quot;true&quot;, no aria-labelledby pointing at the title. A screen reader has no way of knowing this is a dialog, that it&#39;s open, or what it&#39;s called.</li><li><strong>Nothing happens to focus when the modal opens: </strong>Focus stays wherever it was on the page behind it, so a keyboard or screen reader user has no indication anything has appeared at all.</li><li><strong>There’s no focus trap:</strong> Tab far enough and focus leaves the modal and carries on into the page underneath, while the modal is still sitting visually on top of it.</li><li><strong>Closing doesn’t return focus:</strong> Even if you could reach the close control by keyboard, nothing sends focus back to whatever opened the modal in the first place.</li><li>openModal <strong>and </strong>closeModal <strong>only touch CSS:</strong> Toggling display doesn&#39;t tell assistive technology anything changed. There&#39;s no equivalent update to aria-hidden or focus state anywhere in the logic.</li><li>.modal-title <strong>and </strong>.modal-body <strong>are just </strong>&lt;div&gt;<strong> elements:</strong> No heading element, so there&#39;s nothing here a screen reader user could jump to directly even if the rest worked.</li></ul><p>They all might pass a glance in the browser, but one of them would survive five minutes with a keyboard or a screen reader switched on.</p><p>Fixing the markup isn’t the whole job either. Swap the &lt;span&gt; for a real &lt;button&gt; and you&#39;ve solved the structural problem, but the styling that comes with it is often just as thoughtless:</p><pre>.modal-close {<br>  background: none;<br>  border: none;<br>  font-size: 1.5rem;<br>  line-height: 1;<br>  cursor: pointer;<br>  color: #666666;<br>}<br><br>.modal-close:hover {<br>  color: #333333;<br>}</pre><p>There’s a hover state here and nothing else. No :focus or :focus-visible handling at all, which means a keyboard user tabbing to this button gets whatever the browser&#39;s default outline happens to be, if one hasn&#39;t been stripped out elsewhere in the stylesheet - and on a lot of generated CSS, a blanket * { outline: none; } means it&#39;s stripped without anyone deciding to strip it. A button someone can now reach by keyboard, with no visible indication they&#39;ve reached it, is barely an improvement on one they couldn&#39;t reach at all.</p><p>At minimum, this needs a :focus-visible state with a contrast ratio of at least 3:1 against both the button and its background, matching what WCAG 2.2 actually requires:</p><pre>.modal-close:focus-visible {<br>  outline: 2px solid #1a1a1a;<br>  outline-offset: 2px;<br>}</pre><p>It’s a small addition, but it’s exactly the kind of thing that gets generated as an afterthought, if it gets generated at all. Semantic markup gets a component onto the accessibility tree. It doesn’t automatically make that presence visible to the person navigating by keyboard.</p><p>This pattern turns up constantly, not just in modals. Ten or so accessibility failures in twenty or thirty lines of generated markup is close to the norm: missing landmarks, no heading structure, click handlers on non-interactive elements, unlabelled icons, ARIA attributes either missing where needed or added somewhere they’re not.</p><h4>Why this happens</h4><p>It’s tempting to treat this as the AI being careless. That’s not quite it. AI code generation tools learn from the code that exists, and most public front-end code on GitHub is exactly this kind of non-semantic markup: divs and spans with click handlers, roles bolted on inconsistently, ARIA used as decoration rather than structure. The model isn’t malfunctioning. It’s reproducing the average of what it was trained on, and the average is pretty bad.</p><p>There’s a second factor that makes this worse rather than better: most developers reviewing AI-generated output were never taught to spot what’s wrong with it in the first place. <a href="https://medium.com/@sturit/accessibility-is-part-of-the-job-2c655cbf0c31">I mentioned in another article</a>, that accessibility barely features in most university and college courses, so a lot of developers reach production without ever having built an understanding of the accessibility tree, or spent real time with a screen reader. When AI-generated code looks plausible and passes a quick visual check, there’s nothing prompting a second look, because nothing in that developer’s training told them a second look was needed.</p><p>That’s the real problem sitting underneath the WebAIM numbers. It’s not that AI tools produce inaccessible code - though they do - it’s that a lot of the people reviewing that code don’t yet have the knowledge to catch it. The tool moves fast. The gap in understanding doesn’t close on its own, and nothing about “vibe coding” faster changes that.</p><h4>The prompt is part of the problem too</h4><p>Reviewing the output is only half of it. What you ask for in the first place matters just as much, and prompting well is its own skill. And it’s one that’s just as easy to be missing without realising it.</p><p>“<em>Build me a modal a user can easily close</em>” is a perfectly normal thing to type, and it will get you the kind of modal further up this article: an overlay, title, a close control, done. Nothing in that prompt tells the model that the close control needs to be a real button, that focus needs to move into the modal on open and back out on close, that <em>Escape </em>should close it, or that it needs a role announcing it as a dialog. The model isn’t withholding any of that. It was never asked for it.</p><p>The obvious fix sounds simple: ask for an accessible modal, following modern standards. But that only works if you already know what “accessible” actually means for a modal specifically: role=&quot;dialog&quot; and aria-modal=&quot;true&quot;, a focus trap, focus restoration on close, an accessible name pointing at the title, and full keyboard support including <em>Escape</em>.</p><p>If you don&#39;t know what’s needed, &quot;<em>make it accessible</em>&quot; is just a hopeful instruction sitting on top of a prompt that still doesn&#39;t specify any of it. You can end up with a request that sounds thorough and still gets you the same broken markup, because neither the prompt nor the person reading the output knew what was missing.</p><p>This is the same gap as before, just showing up earlier in the process. A developer who’s never had to think about focus trapping can’t ask an AI tool to build a focus trap, in the same way they wouldn’t have written one themselves before AI. The tool has changed how fast bad code gets produced. It hasn’t changed what you need to know to stop it happening.</p><h4>What a well-informed prompt could have produced</h4><p>Here’s what that gap actually costs you. A developer who knew the browser has had a native &lt;dialog&gt; element (widely supported since 2022), could have prompted for that instead of a bespoke div-based overlay - and most of the problems above would never have existed to fix.</p><pre>&lt;button command=&quot;show-modal&quot; commandfor=&quot;subscribe-dialog&quot;&gt;<br>  Subscribe<br>&lt;/button&gt;<br><br>&lt;dialog id=&quot;subscribe-dialog&quot; aria-labelledby=&quot;subscribe-title&quot; aria-describedby=&quot;subscribe-desc&quot; closedby=&quot;any&quot;&gt;<br>  &lt;h2 id=&quot;subscribe-title&quot;&gt;Confirm your subscription&lt;/h2&gt;<br>  &lt;p id=&quot;subscribe-desc&quot;&gt;You&#39;re about to subscribe to our newsletter.&lt;/p&gt;<br>  &lt;form method=&quot;dialog&quot;&gt;<br>    &lt;button value=&quot;confirm&quot;&gt;Confirm&lt;/button&gt;<br>    &lt;button value=&quot;cancel&quot;&gt;Cancel&lt;/button&gt;<br>  &lt;/form&gt;<br>&lt;/dialog&gt;</pre><p>Opened with showModal() (or declaratively here, via the command/commandfor pair on the trigger button), &lt;dialog&gt; gives you a genuinely surprising amount for free:</p><ul><li><strong>An implicit dialog role: </strong>No role=&quot;dialog&quot; to remember, and no risk of it being applied to the wrong element.</li><li><strong>Native focus trapping:</strong> The browser keeps focus inside the dialog while it’s open, and moves it back to the triggering button when it closes. Nothing to wire up by hand.</li><li><strong>The rest of the page becomes properly inert:</strong> Content behind a modal dialog is unreachable by keyboard and hidden from assistive technology automatically, rather than relying on a manually managed aria-hidden toggle that&#39;s easy to get out of sync.</li><li><strong>Escape closes it by default:</strong> With showModal(), this is the built-in behaviour with no closedby value set at all.</li><li>closedby=&quot;any&quot;<strong>, where you want it, adds light-dismiss:</strong> Clicking outside the dialog closes it too, matching the popover pattern users already expect - though this attribute still has limited availability in mid-2026, so treat it as progressive enhancement rather than something to rely on everywhere yet.</li><li>&lt;form method=&quot;dialog&quot;&gt;<strong> closes the dialog on submit</strong> without any JavaScript wiring it up.</li></ul><p>All of this has been in the HTML spec for years, and there’s nothing too experimental about it. That said, &lt;dialog&gt; doesn’t solve everything on its own; it still needs a real accessible name, still needs testing with a screen reader, and closedby support does needs tested before you rely on it.</p><p>The point is that a developer who knew this element existed, and knew what an accessible modal actually requires, could have asked for it by name, and an AI tool would have produced something far closer to correct on the first pass. The knowledge has to come first, and the prompt is only ever as good as what you already know.</p><h4>What to check for in review</h4><p>You don’t need to go through AI-generated code line by line, assuming the worst. You do need to check a specific, recurring set of things, because these are the failures that turn up constantly and rarely fix themselves.</p><ul><li><strong>Semantic elements instead of styled divs and spans:</strong> Anything that behaves like a button should be a &lt;button&gt;. Anything that behaves like a link should be an &lt;a&gt; with a real href. If the generated markup reaches for a &lt;div&gt; or &lt;span&gt; with an onclick, that&#39;s the first thing to fix, not the last.</li><li><strong>Keyboard operability, tested directly:</strong> Put the mouse to one side and tab through whatever has just been generated. Can you reach every interactive element? Can you activate it with <em>Enter </em>or <em>Space</em>? Can you close a modal with <em>Escape</em>? If any of that fails, the component isn’t finished, regardless of how it looks.</li><li><strong>ARIA that’s there for the sake of it, not because it’s needed:</strong> AI tools tend to over-apply ARIA, and this means roles on elements that already have the correct native semantics, aria-label attached to things that just needed better visible text, aria-hidden on something still reachable by keyboard. Redundant or contradictory ARIA is often worse than none at all, so check what&#39;s actually necessary and remove the rest.</li><li><strong>Focus management on anything dynamic:</strong> this covers modals, dropdowns, mega-menus, accordions, and anything similar. When something opens, does focus move into it? When it closes, does focus return to where it came from? Generated code very rarely handles this correctly by default, and it’s one of the easiest things to miss because it only shows up when you test with a keyboard.</li><li><strong>Landmarks and heading structure:</strong> A component built in isolation often arrives with no &lt;nav&gt;, &lt;section&gt;, or heading hierarchy at all, because the AI has no view of where it sits on the page. Check that it works within a structure that still makes sense with the styles switched off.</li><li><strong>Interactive states and contrast:</strong> Check that every interactive element has a visible hover state, a proper :focus-visible state, and enough contrast against its background - not just in its default state, but when focused and disabled too. This is exactly the kind of thing that gets left out when a component is generated in isolation, as covered earlier with the modal close button.</li><li><strong>Labels on anything that takes input:</strong> Check that form fields, icon-only buttons, and custom controls have a real accessible name, not just a placeholder or a visual icon that means nothing to a screen reader.</li></ul><p>It’s the same list you’d run through on code you wrote yourself, nothing added specifically for AI output. The difference is that AI-generated code looks finished faster, which makes it easier to skip the checks altogether.</p><h4>Where this leaves you</h4><p>AI tools didn’t invent inaccessible code. The web was already 95.9% non-compliant before <em>vibe coding </em>became a thing. What’s changed is the speed at which that kind of code now gets produced and shipped, and the number of people accepting it without knowing what to look for.</p><p>The fix isn’t a better prompt. It’s a developer who knows what correct markup looks like, checks for it deliberately, and doesn’t treat “<em>it works when I click it</em>” as the same thing as “<em>it works</em>”.</p><p>That was true before AI wrote any of your code, and it’s still true now - it’s just easier to forget when everything looks fine on the surface.</p><h4>Resources</h4><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web"><strong>MDN Web Docs</strong></a><strong>:</strong> the reference for HTML semantics, ARIA attributes, and accessibility-related CSS</li><li><a href="https://www.w3.org/WAI/ARIA/apg/"><strong>ARIA Authoring Practices Guide</strong></a><strong> (APG): </strong>the reference for correct keyboard behaviour and ARIA usage on dialogs, menus, tabs, accordions and more</li><li><a href="https://www.w3.org/WAI/WCAG22/quickref/"><strong>How to meet WCAG</strong></a><strong>: </strong>a quick reference to the Web Content Accessibility Guidelines</li><li><a href="https://medium.com/@sturit/accessibility-is-part-of-the-job-2c655cbf0c31"><strong>Accessibility is part of the job</strong></a><strong>: </strong>my previous article on web accessibility for developers, covering the fundamentals with a list of tools and further reading</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72942319af81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accordions with the details element, now that the CSS actually works]]></title>
            <link>https://sturit.medium.com/accordions-with-the-details-element-now-that-the-css-actually-works-3d29a6f86957?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d29a6f86957</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 13:24:37 GMT</pubDate>
            <atom:updated>2026-07-22T13:24:37.833Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="An old accordion musical instrument lying in the street" src="https://cdn-images-1.medium.com/max/1024/0*bTY6-2rl9NrHa4Ps" /><figcaption>Photo by <a href="https://unsplash.com/@n2norme?utm_source=medium&amp;utm_medium=referral">Nicolas Denorme</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In 2024, on an old blog, I wrote about building an accessible accordion from scratch with traditional HTML, CSS, and JavaScript. At the time I also looked at the &lt;details&gt; element as a native alternative, but shelved the idea of animating it properly - the CSS needed to do it smoothly was Chrome-only and still experimental, and I didn&#39;t want to build something that only half worked.</p><p>That’s changed. ::details-content, the piece that makes a smooth open and close possible, became Baseline in September 2025 and now works across current browsers, not just Chromium. So this is a follow-up, revisiting the animation I put off and looking at what a properly built &lt;details&gt; accordion looks like now that the support is actually there.</p><p>One thing I’m not covering here: calc-size(), which some more recent examples use alongside interpolate-size for a bit more control over the expanded height. Worth knowing it exists, but it&#39;s not necessary for what follows, so I&#39;ve kept this to the simpler approach.</p><h4>Background</h4><p>There’s no shortage of ways to build an accordion, and picking the “right” one — particularly with accessibility in mind — can turn into its own small research project. &lt;details&gt; sidesteps most of that. It&#39;s a native HTML element that gives you collapsible content with no JavaScript and no accessibility guesswork, because the browser is already handling the hard parts.</p><p>The element wraps your collapsible content, and a &lt;summary&gt; inside it acts as the clickable heading. Everything else inside &lt;details&gt; stays hidden until someone interacts with the summary.</p><pre>&lt;details&gt;<br>  &lt;summary&gt;View the details on my topic&lt;/summary&gt;<br>  &lt;p&gt;This is the content that will be shown when the accordion is expanded.&lt;/p&gt;<br>  &lt;p&gt;So will this content.&lt;/p&gt;<br>&lt;/details&gt;</pre><p>That’s a working, keyboard-accessible piece of collapsible content, with nothing but HTML.</p><h4>Notable attributes</h4><p><strong>open</strong> - controls whether the content is visible by default. Add it, and the section starts expanded. Leave it off, and it stays collapsed until someone clicks.</p><p><strong>name</strong> - groups multiple &lt;details&gt; elements together so only one stays open at a time, similar to radio buttons. The grouped elements don&#39;t need to sit next to each other in the markup for this to work.</p><h4>Accessibility, and where to be careful</h4><p>Because &lt;details&gt; is a standard HTML element, screen readers and keyboard navigation are handled for you, out of the box. That&#39;s most of the accessibility work already done before you&#39;ve written any CSS.</p><p>A few things worth knowing:</p><ul><li><strong>Keyboard support</strong> is built in. Tab to the summary, then use Enter or Space to toggle it open and closed.</li><li><strong>ARIA states</strong> are handled automatically — aria-expanded and an implicit group role are already there. You don&#39;t need to add these yourself. The <a href="https://www.w3.org/TR/wai-aria-1.1/#group">ARIA group role</a> has more detail if you want it.</li><li><strong>Test across browsers and assistive technology anyway.</strong> &lt;details&gt; behaves consistently in the browsers I&#39;ve checked, but &quot;consistent in Chrome&quot; and &quot;consistent everywhere&quot; aren&#39;t the same claim. Safari, in particular, still needs ::-webkit-details-marker alongside the standard ::marker if you&#39;re customising the disclosure triangle.</li><li><strong>SEO is unaffected.</strong> Content inside a closed &lt;details&gt; is still crawlable and indexable. Nothing extra to do here.</li></ul><h4>Styling it up</h4><p>The default look is plain — functional, but not something you’d want to ship as-is. It doesn’t take much to bring it in line with a more conventional accordion design.</p><pre>&lt;details&gt;<br>  &lt;summary&gt;Accordion Item 1 &lt;span aria-hidden=&quot;true&quot; class=&quot;icon-arrow&quot;&gt;&lt;/span&gt;&lt;/summary&gt;<br>  &lt;div class=&quot;content&quot;&gt;<br>    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae eros eu nulla venenatis malesuada.&lt;/p&gt;<br>    &lt;p&gt;Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/details&gt;</pre><p>What the styling below does:</p><ul><li>&lt;details&gt; gets a border and rounded corners, so it reads as a self-contained component. Overflow is hidden, which matters once we get to the animation.</li><li>&lt;summary&gt; is styled to look and behave like a button - flex with space-between to keep the label and arrow icon apart, plus a bold font, a background colour, and hover/focus states.</li><li>When open, the summary’s background shifts slightly and the arrow rotates, giving a small visual cue that the section can be closed again.</li><li>Inner content is wrapped in a .content div, purely so it&#39;s easy to target and space out with flex.</li><li>margin-block-start handles spacing when multiple &lt;details&gt; elements are stacked.</li></ul><pre>details {<br>  --details-border-radius:  0.375rem;<br><br>  border: 2px solid #333;<br>  border-radius: var(--details-border-radius);<br>  background-color: #fff;<br><br>  summary {<br>    cursor: pointer;<br>    display: flex;<br>    justify-content: space-between;<br>    align-items: center;<br>    text-align: left;<br>    font-size: 1.125rem;<br>    font-weight: 700;<br>    gap: 0.938rem;<br>    padding: 0.938rem;<br>    background-color: #fdf7ed;<br>    border-radius: var(--details-border-radius);<br>    color: #363636;<br>    transition: background-color 0.3s, color 0.3s;<br>    font-family: &#39;Inter&#39;, sans-serif;<br><br>    &amp;:hover,<br>    &amp;:focus-visible {<br>      background-color: #f7e4d9;<br>    }<br><br>    .icon-arrow {<br>      display: block;<br>      height: 24px;<br>      width: 24px;<br>      background-position: center;<br>      background-size: contain;<br>      background-image: url(https://medium.com/&#39;data:image/svg+xml,&lt;svg%20height=&quot;48&quot;%20viewBox=&quot;0%200%2048%2048&quot;%20width=&quot;48&quot;%20xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path%20d=&quot;M14.83%2016.42l9.17%209.17%209.17-9.17%202.83%202.83-12%2012-12-12z&quot;/&gt;&lt;path%20d=&quot;M0-.75h48v48h-48z&quot;%20fill=&quot;none&quot;/&gt;&lt;/svg&gt;&#39;);<br>      transition: rotate 0.3s;<br>    }<br>  }<br><br>  .content {<br>    padding: 1.25rem;<br>    background-color: #fff;<br>    display: flex;<br>    flex-direction: column;<br>    gap: 0.938rem;<br><br>    * {<br>      margin-bottom: 0;<br>    }<br>  }<br><br>  + details {<br>    margin-block-start: 0.9375rem;<br>  }<br><br>  &amp;[open] summary {<br>    background-color: #f7e4d9;<br><br>    .icon-arrow {<br>      rotate: 180deg;<br>    }<br>  }<br><br>  p {<br>    margin: 0;<br>    font-size: 1rem;<br>    font-weight: 400;<br>    line-height: 1.4;<br>    font-family: &#39;Inter&#39;, sans-serif;<br>  }<br>}</pre><p><a href="https://codepen.io/sturit/pen/bNbmXjg">Click here to see an example on CodePen</a>.</p><p>A quick aside: I’ve used &amp;[open] here rather than the newer :open pseudo-class, mainly for older browser coverage. If you don&#39;t need to support anything older, :open reads a bit more clearly and does the same job.</p><h4>A smoother experience</h4><p>This is the part that’s changed most since 2024. Animating display or visibility has always been awkward, because they&#39;re discrete properties - they don&#39;t have a range of values to move through, so browsers just flip them from one state to the other. No amount of transition CSS used to fix that on its own.</p><p>The workaround now lives in the CSS spec itself, and it’s not a hack anymore.</p><p>Credit where it’s due: I picked most of this up from Kevin Powell, who’s covered the &lt;details&gt; animation problem properly on his channel. Worth a watch if you want the full breakdown - link at the end.</p><pre>:root {<br>  interpolate-size: allow-keywords;<br>}<br><br>details {<br>  overflow: hidden;<br><br>  &amp;::details-content {<br>    block-size: 0;<br>    transition: block-size 0.3s, content-visibility 0.3s;<br>    transition-behavior: allow-discrete;<br>  }<br><br>  &amp;[open]::details-content {<br>    block-size: auto;<br>  }<br>}</pre><h4>What’s actually happening here</h4><p><strong>interpolate-size: allow-keywords</strong> tells the browser it&#39;s allowed to animate towards a keyword like auto, rather than snapping straight to it. One caveat worth being upfront about: this property is still Chromium-only and isn&#39;t Baseline. Safari and Firefox users won&#39;t get the height animation - they&#39;ll get the content opening instantly instead, which is a perfectly usable fallback, just not a smooth one. <a href="https://caniuse.com/?search=interpolate-size">Check current support on Can I Use</a> before relying on it for anything that needs to look identical everywhere.</p><p><strong>::details-content</strong> is the part that&#39;s now solid. It targets the collapsible content area directly, without needing an extra wrapper div. Starting it at block-size: 0 hides it; setting block-size: auto on the open state lets it expand to fit whatever&#39;s inside.</p><p><strong>transition-behavior: allow-discrete</strong> is what makes the whole thing work. It lets properties like content-visibility, which would normally just flip between states, transition instead. Without it, none of this animates - the section would just snap open and shut regardless of what else you&#39;d written.</p><p><strong>content-visibility in the transition</strong> gives you a matching animation on close, not just on open. Leave it out, and closing looks abrupt even if opening looks smooth.</p><p><strong>overflow: hidden</strong> keeps content from spilling out while the height is mid-transition.</p><h3>Why this matters</h3><p>None of this breaks &lt;details&gt; for browsers that don&#39;t support the newer CSS. Without ::details-content or interpolate-size, the element still works exactly as it always has - it just opens and closes instantly instead of animating. Nobody loses functionality; some people get a nicer transition.</p><h3>Conclusion</h3><p>&lt;details&gt; was already a solid, accessible way to build an accordion with barely any code. What&#39;s changed is that the last real gap - a smooth, native animation - now has proper, Baseline-level browser support behind it, rather than a Chrome-only workaround.</p><p>If you tried this a year or two ago and shelved it because the support wasn&#39;t there yet, it&#39;s worth another look.</p><h3>Further reading &amp; resources</h3><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details">Details element information at MDN</a></li><li><a href="https://web.dev/learn/html/details">Details element information at web.dev</a></li><li><a href="https://www.youtube.com/watch?v=Vzj3jSUbMtI">Kevin Powell’s amazing video on animating the Details element</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/interpolate-size">interpolate-size information at MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::details-content">details-content pseudo element information at MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transition-behavior#allow-discrete">allow-discrete information at MDN</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d29a6f86957" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessibility is part of the job]]></title>
            <link>https://sturit.medium.com/accessibility-is-part-of-the-job-2c655cbf0c31?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c655cbf0c31</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 07:15:59 GMT</pubDate>
            <atom:updated>2026-07-02T14:37:20.728Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical introduction to web accessibility for developers</h4><figure><img alt="A woman rests her chin on one hand while typing with the other, looking at code on a mac desktop in a softly lit room." src="https://cdn-images-1.medium.com/max/1024/0*oeipgNn2ssgO5-9P" /><figcaption>Photo by <a href="https://unsplash.com/@kellysikkema?utm_source=medium&amp;utm_medium=referral">Kelly Sikkema</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>In every digital project, accessibility either gets considered properly or it doesn’t. As a developer, a lot of that sits with you.</strong></p><p>Project managers can ask the right questions at kick-off. Designers can spec the right colour contrast. Content editors can write appropriate alt text. But if the developer doesn’t understand accessibility, or doesn’t prioritise it, none of that upstream work holds.</p><p>That’s not meant as pressure for the sake of it. It’s just the reality of where developers sit in a project. You’re the last person before something ships. What you build is what users will interact with.</p><p>Plenty of those users will be navigating differently to how you might expect. They might be using a keyboard instead of a mouse, a screen reader instead of a display, or voice control instead of either. Some will have motor impairments, cognitive differences, low vision, or conditions that make certain design patterns actively harmful. They’re not edge cases. They’re users, and right now, a lot of the web doesn’t work for them.</p><p>The <a href="https://webaim.org/projects/million/"><strong>2026 WebAIM Million report</strong></a>, which analyses the top one million home pages, found that 95.9% had detectable WCAG failures, with an average of 56.1 errors per page. What makes that figure particularly hard to ignore is the direction of travel. After six consecutive years of slow but measurable improvement, 2026 reversed the trend. Detected errors rose 10.1% since 2025, so things are getting worse, not better. Somewhere in those numbers is almost certainly work you’ve shipped.</p><p>This article isn’t a checklist. There are plenty of those, and they have their place. This is about something more fundamental: understanding why accessibility is a core development skill, what it actually requires of you, and why treating it as an optional extra means you’re not doing your job properly.</p><h3>Why this falls on you: the legal landscape</h3><p>Accessibility isn’t just good practice. In most of the markets your clients operate in, it’s a legal requirement, and that requirement is getting more specific, more enforceable, and harder to ignore.</p><p>Most developers know accessibility rules exist. Far fewer could tell you which standard those rules come from, or what’s changed in the last year. That gap matters. When something ships broken, it’s the product that’s failed, regardless of who made which decisions during the project.</p><h4><strong>Examples of where things stand</strong></h4><ul><li><strong>In the UK</strong>, the <strong>Equality Act 2010 </strong>requires that services are accessible to people with disabilities, and that includes websites. Public sector organisations have additional obligations under the <strong>Public Sector Bodies Accessibility Regulations 2018</strong>, covering compliance statements, testing requirements, and named contacts for reporting issues. Private sector organisations aren’t exempt from the Equality Act, and courts have increasingly been willing to apply it to digital services.</li><li><strong>In the EU</strong>, the <strong>European Accessibility Act </strong>came into force in 2025, extending accessibility requirements beyond the public sector to a wide range of commercial products and services. If you’re building anything for a client that operates in Europe, this applies.</li><li><strong>In the US</strong>, the DOJ finalised a rule under Title II of the <strong>Americans with Disabilities Act</strong> (ADA) setting WCAG 2.1 Level AA as the explicit technical standard for state and local government websites and mobile apps. Compliance deadlines have since been extended to 2027, but the standard is set and the direction is clear. <strong>Section 508 </strong>continues to apply separately to federal agencies and their contractors.</li></ul><p>All of these reference <a href="https://www.w3.org/TR/WCAG22/"><strong>Web Content Accessibility Guidelines</strong></a><strong> </strong>(WCAG). Which means understanding WCAG isn’t optional background reading. It’s the technical standard your work is being measured against.</p><p>This isn’t about reducing accessibility to legal risk management either. The reason to build accessibly is that real people depend on it. But if that’s not enough to make you want to do things right, the legal side should be.</p><h3>Educate yourself: this is non-negotiable</h3><p>Most developers learn accessibility the same way they learn everything else: by picking bits up as they go, copying patterns from Stack Overflow, prompting AI when building a component, and using whatever comes back without reading it closely enough to know whether it’s right.</p><p>University and college courses rarely give it proper coverage either, so most people start their career without a foundation to build on.</p><p>That approach doesn’t work for accessibility, and the gap it leaves is a real problem.</p><ul><li>You can write HTML every day for years and still not understand how the browser turns it into something a screen reader can use.</li><li>You can use ARIA attributes in good faith and make the experience actively worse.</li><li>You can pass a Google Lighthouse check and ship something that a keyboard user can’t navigate.</li></ul><p>These aren’t edge cases. They’re common, and they happen because accessibility requires a type of understanding that most developers were never taught and never sought out. That needs to change, and it starts with understanding a few things properly.</p><h4>The accessibility tree</h4><p>When a browser parses your HTML, it builds two things: the visual render you can see, and an accessibility tree that assistive technologies use to understand and navigate the page. These are not the same thing. An element can look right on screen and be completely meaningless, or actively misleading, in the accessibility tree.</p><p>Understanding what the accessibility tree is, how it’s built, and how your markup affects it is foundational. Without it, you’re guessing. <a href="https://developer.chrome.com/blog/full-accessibility-tree">Chrome DevTools has an accessibility panel</a> that lets you inspect it directly. Start using it to get an understanding of the accessibility tree of your work.</p><h4>How screen readers actually work</h4><p>You don’t need to become a screen reader expert, but you do need a working understanding of how they interact with your code. Screen readers don’t read a page the way a sighted user scans it. They move through the accessibility tree, announce roles and states, and depend entirely on your markup being correct and meaningful.</p><p>The only way to properly understand screen readers is to use one. <em>VoiceOver</em> is built into macOS and iOS, <a href="https://www.nvaccess.org/about-nvda/"><em>NVDA</em></a><em> </em>is free on Windows, and Android has <em>TalkBack</em>. Pick one and spend real time navigating pages with it. It’s a different way of navigating, but that difference is worth paying attention to.</p><h4>WCAG: the standard</h4><p>WCAG exists as a baseline. Meeting it means you’ve cleared a minimum bar, not that you’ve built something genuinely usable. Some sites can pass every WCAG success criterion and still be confusing, frustrating, or unusable for people with certain access needs.</p><p>Get to know the standard. Know what level your project needs to meet and why, but don’t treat passing criteria as the goal. The goal is that real people can use what you’ve built.</p><p>There is no shortcut here. Reading, testing, and building up experience over time is the only way through. The resources section at the end of this article is a starting point.</p><h3>Semantic HTML isn’t optional</h3><p>Semantic HTML is the foundation everything else is built on. Get it wrong and no amount of ARIA, JavaScript, or careful styling will fully compensate. Get it right and you’ve done the majority of the heavy lifting before you’ve written a single line of CSS.</p><p>Most developers know what semantic HTML is. Fewer write it consistently, and fewer still understand what’s actually at stake when they don’t.</p><p>When you use a &lt;button&gt; element, the browser gives you keyboard operability, focus management, and the correct ARIA role for free. When you use a &lt;div&gt; with an onClick handler instead, you get none of that. Here&#39;s what that looks like in practice.</p><p>Say you’re building a “close” button for a notification banner. Written like this:</p><pre>&lt;div class=&quot;btn-close&quot; onclick=&quot;closeBanner()&quot;&gt;<br>  Close<br>&lt;/div&gt;</pre><p>It looks right. It’s styled like a button, it responds to a click, and a sighted mouse user won’t notice anything wrong. But in the accessibility tree, that &lt;div&gt; has no role, no keyboard support, and no indication it&#39;s interactive at all. A screen reader announces it as plain text. A keyboard user can&#39;t tab to it. It fails silently.</p><p>Written like this instead:</p><pre>&lt;button type=&quot;button&quot; class=&quot;btn-close&quot; onclick=&quot;closeBanner()&quot;&gt;<br>  Close<br>&lt;/button&gt;</pre><p>Same visual result, same click behaviour, but now the browser gives you a button role in the accessibility tree automatically, native keyboard support (<em>enter </em>and <em>space </em>both activate it), and correct focus handling, all without writing a single extra line.</p><p>That’s the whole argument for semantic HTML in miniature. The &lt;div&gt; version needed more code to become genuinely accessible, not less, and it&#39;s easy to ship it without ever noticing what&#39;s missing.</p><p>The same logic applies across the board. &lt;nav&gt;, &lt;main&gt;, &lt;header&gt;, &lt;footer&gt;, and &lt;aside&gt; aren&#39;t decorative. They create landmarks that screen reader users navigate by directly, in the same way a sighted user might scan a page visually to find the section they want. A page built entirely from &lt;div&gt; and &lt;span&gt; elements has none of that structure. It&#39;s a flat, undifferentiated block of content to anyone not reading it visually.</p><p>Heading order matters too. Headings aren’t just a way to make text bigger or to style the page. They’re the outline of your page, and screen reader users navigate by them constantly. A broken heading hierarchy, skipped levels, or headings chosen for their visual size rather than their structural meaning, makes that navigation unreliable or impossible.</p><p>The rule is straightforward: use the correct element for the job. If something is a button, use &lt;button&gt;. If something is a list, use &lt;ul&gt; or &lt;ol&gt;. If something is a navigation region, use &lt;nav&gt;. Don&#39;t reach for a generic element and patch accessibility on afterwards. That&#39;s not a workaround, it&#39;s a habit that compounds across an entire codebase.</p><p>If you’re not sure which element to use, the <a href="https://developer.mozilla.org/en-US/">MDN Web Docs</a> is the right place to start. The <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements">HTML elements reference</a> documents the semantics, default behaviour, and accessibility implications of every element. I think this should be a tab you always have open, not a page you only visit once.</p><h3>ARIA: use it carefully</h3><p>ARIA (Accessible Rich Internet Applications) exists to fill gaps that HTML alone can’t cover. Custom components, dynamic content, complex UI patterns that have no native HTML equivalent. Used correctly, it makes the difference between something a screen reader user can operate and something they can’t. Used incorrectly, it actively makes things worse. That second outcome is more common than the first.</p><p>The first rule of ARIA use is: if you can use a native HTML element that provides the semantics you need, use that instead. role=&quot;button&quot; on a &lt;div&gt; is not an alternative to &lt;button&gt;. It&#39;s a sign that the wrong element was reached for in the first place.</p><p>Where ARIA is genuinely needed, the most common mistakes are worth knowing.</p><ul><li><strong>Applying roles without the required keyboard behaviour</strong>: adding role=&quot;dialog&quot; to a modal doesn&#39;t automatically make it keyboard accessible. You still need to manage focus, trap it within the dialog while it&#39;s open, and return it to the correct place when it closes. The <em>role </em>tells assistive technology what something is. It doesn&#39;t do the work of making it behave correctly.</li><li><strong>Using <em>aria-label </em>to paper over poor structure</strong>: if an element needs a label to make sense, that&#39;s often a sign the underlying HTML needs rethinking rather than an annotation added on top.</li><li><strong>Redundant or conflicting attributes</strong>: aria-hidden=&quot;true&quot; on a focusable element, for example, hides it from the accessibility tree while leaving it reachable by keyboard. That creates a genuinely confusing experience where focus lands on something a screen reader user can&#39;t perceive.</li><li><strong>Overusing <em>aria-live </em>regions</strong>: announcing every dynamic change on a page creates noise that makes it harder, not easier, to use. Live regions are for genuinely important updates that a user needs to know about without moving focus.</li></ul><p>The <a href="https://www.w3.org/WAI/ARIA/apg/">ARIA Authoring Practices Guide</a> documents the correct patterns for common components: dialogs, menus, tabs, accordions, and more. It includes the expected keyboard behaviour, the correct roles and attributes, and working examples. If you’re building a custom component, have a look there before you start coding.</p><p>The short version is this: ARIA is a tool for specific situations, not a layer to add once the HTML is written. If you find yourself reaching for it frequently, that’s usually a sign the approach or markup underneath needs a bit of attention first.</p><h3>Keyboard and focus management</h3><p>Keyboard accessibility is one of the most commonly broken things on the web, and one of the easiest to test. Unplug your mouse, or push it to one side, and try to use what you’ve just built. That’s really the whole test. If you can’t get through it comfortably, neither can the people who depend on a keyboard every day.</p><p>Those people include users with motor impairments, <em>power users </em>who prefer the keyboard, and anyone using <em>switch access </em>or other assistive input devices. It’s not a small group, and they have no fallback when keyboard access is broken.</p><h4>Tab order and focus management</h4><p>Focus should move through the page in a logical order that matches the visual layout and the reading flow of the content. In most cases, correct HTML structure handles this automatically. Problems tend to appear when layouts are built with CSS that visually reorders content away from its source order, or when JavaScript manipulates the DOM without considering where focus should go next.</p><p>When a user opens a modal, focus should move into it. When they close it, focus should return to the element that triggered it. When content is dynamically added to the page, focus should be managed so the user is aware something has changed. None of this happens automatically. It has to be built deliberately.</p><p>Tab index is worth understanding properly:</p><ul><li>tabindex=&quot;0&quot; adds an element to the natural tab order.</li><li>tabindex=&quot;-1&quot; removes it from the tab order but allows it to receive focus programmatically, which is useful for managing focus in custom components.</li><li>Positive tabindex values override the natural order and should almost never be used. If you find yourself using tabindex=&quot;2&quot; or higher, the underlying structure needs attention.</li></ul><h4>Visible focus indicators</h4><p>Every interactive element needs a visible focus state. This is not optional, and “<em>we removed the outline because it looked bad</em>” is not a great reason for shipping without one. Some UI libraries strip it out by default too, so it’s worth checking rather than assuming it’s there.</p><p>WCAG 2.2 introduced a minimum <em>focus appearance </em>requirement. The focus indicator needs to meet a contrast ratio of at least 3:1 between the focused and unfocused states. A faint ring or a barely visible outline doesn’t meet that bar.</p><p>The default browser focus styles have improved in recent years and are worth reconsidering before replacing them with something custom. If you do style focus indicators yourself, test them. Check the contrast, check they’re visible across different browsers, and check they’re consistent across every interactive element on the page.</p><h4>Skip links</h4><p>A skip link lets keyboard users jump past repeated navigation to the main content of the page. Without one, every page load means tabbing through the entire header and navigation before reaching the actual content.</p><p>The implementation is simple: an anchor at the top of the page pointing to the main element, visually hidden by default and visible on focus.</p><p>What trips people up is the target. In most browsers, &lt;main id=&quot;content&quot;&gt; will pick up focus correctly once you navigate to it, but this isn&#39;t universal. Some developers still add tabindex=&quot;-1&quot; as a safeguard, though recent testing suggests it can cause its own problems. So make sure to test your specific setup properly.</p><h4>Custom components</h4><p>Custom interactive components are where keyboard support most often falls apart. Dropdowns, date pickers, carousels, accordions, tab panels. These patterns have expected keyboard behaviours that users of assistive technology rely on, and those behaviours need to be implemented, not assumed.</p><p>A custom dropdown that opens <em>on click </em>but can’t be navigated with arrow keys, closed with Escape, or operated without a mouse isn’t a dropdown. It’s a broken experience with the visual appearance of one.</p><p>The <a href="https://www.w3.org/WAI/ARIA/apg/">ARIA Authoring Practices Guide</a> covers the expected keyboard interactions for all of these patterns, so remember to use it.</p><h3>Forms</h3><p>Forms are where a lot of accessibility failures easily accumulate. Some are inherited from the design, some are introduced in the build, and some come from the gap between the two.</p><p>By the time a form reaches a user, it can be carrying problems from every stage of the project, but ones introduced at the development stage are yours to own.</p><h4>Labels</h4><p>Every input needs a programmatically associated label. Not a placeholder. Not a &lt;div&gt; sitting visually above the field. A &lt;label&gt; element with a for attribute that matches the input&#39;s id, or an input nested inside its label. This is what connects the label to the field in the accessibility tree, and without it a screen reader user may have no reliable way to know what a field is for.</p><pre>&lt;label for=&quot;email&quot;&gt;Email address&lt;/label&gt;<br>&lt;input<br>  type=&quot;email&quot;<br>  id=&quot;email&quot;<br>  name=&quot;email&quot;<br>  placeholder=&quot;e.g. name@example.com&quot;<br>  required<br>&gt;</pre><p>Placeholder text is not a label. It disappears when the user starts typing, it’s frequently too low contrast to read comfortably, and it provides no fallback when the field is filled. It has a place as supplementary guidance, nothing more.</p><p>aria-label and aria-labelledby can associate a label programmatically when a visible label isn&#39;t possible, but visible labels are almost always preferable.</p><p>An input with no visible label creates problems for users with cognitive differences, users who zoom in and lose surrounding context, and anyone who finds the interface unfamiliar. If a design arrives without visible labels, I always recommend pushing back on it.</p><h4>Error handling</h4><p>Error messages need to be clear, specific, and programmatically associated with the field they relate to. “Please check your input” tells a user nothing useful. “Enter a valid email address, for example polly@example.com” tells them exactly what to fix.</p><p>Use aria-describedby to associate error messages with their fields. When an error appears, move focus to it or to the field it relates to, so keyboard and screen reader users are aware something needs attention. An error that appears somewhere on the page without any notification is effectively invisible to someone not reading visually.</p><pre>&lt;label for=&quot;email&quot;&gt;Email address&lt;/label&gt;<br>&lt;input<br>  type=&quot;email&quot;<br>  id=&quot;email&quot;<br>  name=&quot;email&quot;<br>  placeholder=&quot;e.g. name@example.com&quot;<br>  aria-describedby=&quot;email-error&quot;<br>  aria-invalid=&quot;true&quot;<br>  required<br>&gt;<br>&lt;p id=&quot;email-error&quot; role=&quot;alert&quot;&gt;<br>  Enter a valid email address, for example polly@example.com<br>&lt;/p&gt;</pre><p>For longer forms, an error summary at the top of the page is a great pattern. A list of what went wrong, with each item linking directly to the relevant field. Inline messages alone aren’t enough when a page has multiple errors across a long form.</p><h4>Required fields and input types</h4><p>Mark required fields with the required attribute. This exposes the requirement to assistive technology without relying on visual cues alone. Don&#39;t depend solely on a red asterisk or colour to communicate that a field is mandatory.</p><p>Use the correct type attribute on inputs. type=&quot;email&quot; triggers the right keyboard on mobile and gives browsers and assistive technology the right context. The same applies to type=&quot;tel&quot;, type=&quot;number&quot;, type=&quot;date&quot;, and others. These aren&#39;t cosmetic choices.</p><p>The autocomplete attribute needs to be used correctly too. It lets browsers and assistive technologies help users fill in common fields, which reduces effort and the chance of errors. The WCAG success criterion 1.3.5 covers this, and a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#value">list of valid autocomplete values can be found on MDN</a>.</p><pre>&lt;label for=&quot;fname&quot;&gt;First name&lt;/label&gt;<br>&lt;input type=&quot;text&quot; id=&quot;fname&quot; name=&quot;fname&quot; autocomplete=&quot;given-name&quot;&gt;</pre><h4>Validation timing</h4><p>Avoid validating fields on blur in a way that interrupts users mid-form. Someone tabbing through a form shouldn’t be confronted with an error on a field they haven’t finished filling in yet.</p><p>So make sure to validate on submit, and use inline messages as a secondary layer <em>after </em>the first submission attempt.</p><h3>Colour and motion</h3><p>Colour and motion are often thought of as design concerns, and they are, but the design decisions only hold up if the code respects them. This is the stage where good intentions either get implemented properly or quietly fall apart.</p><h4>Colour</h4><p>Don’t use colour as the only way to convey information in your markup or logic. If a form field turns red to indicate an error, there needs to be more than a colour change happening. An icon, a text message, an aria-invalid attribute. The visual change alone is not enough.</p><p>Forced colour modes are worth understanding. <em>Windows High Contrast</em> mode, and the newer forced-colors CSS media query, replace the page&#39;s colour scheme with a limited system palette. Borders disappear. Background images vanish. Subtle colour differences that your design relies on stop existing entirely.</p><p>Testing in forced colours mode will surface things you won’t find any other way. Elements that were distinguished only by background colour become indistinguishable. Focus indicators that relied on a coloured outline may disappear. Custom icons embedded as background images won’t render at all.</p><pre>.button {<br>  border: 0;<br>  padding: 0.5rem;<br>  background-color: #FFFFFF;<br>  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;<br>}<br><br>@media (forced-colors: active) {<br>  .button {<br>    /* <br>    using a border. <br>    box-shadow is forced to &#39;none&#39; in forced-colors mode.<br>    */<br>    border: 2px solid CanvasText;<br>  }<br>}</pre><p>The forced-colors media query lets you write targeted styles for these situations. So you can use it to restore borders, adjust spacing, or swap background images for inline SVGs that the colour mode can recolour. It&#39;s a small investment that makes a real difference to users who depend on these settings.</p><h4>Motion</h4><p>The prefers-reduced-motion media query is how users signal, through their system settings, that they want less motion. It&#39;s been well supported across browsers for years, so there&#39;s no good reason not to respect it.</p><p>What that looks like in practice depends on the animation. Some can be removed entirely. Others should be reduced to a simple fade or an instant state change rather than a transition.</p><p>The goal isn’t to strip all animation from the experience for these users. It’s to remove motion that could cause disorientation, nausea, or worse for people with vestibular disorders.</p><p><strong>Example CSS:</strong></p><pre>@media (prefers-reduced-motion: reduce) {<br>  * {<br>    animation-duration: 0.01ms !important;<br>    transition-duration: 0.01ms !important;<br>  }<br>}</pre><p>That blanket approach is a reasonable safety net, but it’s a blunt instrument, so it’s better to handle animations individually and decide what a reduced or static alternative should look like for each one. That requires knowing which animations exist and what they’re communicating, which is another reason to have this conversation with designers who provide animation references, before anything is built.</p><p>JavaScript needs to respect this too. Animations driven by JS rather than CSS won’t be caught by a CSS media query. Check the user’s preference with window.matchMedia(&#39;(prefers-reduced-motion: reduce)&#39;) and adjust the behaviour appropriately.</p><p>Anything that flashes more than three times per second is a seizure risk and shouldn’t reach production in any form. This applies regardless of user preferences.</p><h3>Testing: you need to do all of it</h3><p>This is where most developers fall short, and it’s the part that matters most. Building something isn’t the same as knowing it works.</p><p>Accessibility testing isn’t a phase at the end of a project, it’s something that needs to happen throughout the build, and it requires more than running a single tool and calling it done.</p><p>Automated tools are useful, but they’re also limited. The most commonly cited figure is that automated testing catches around 30-40% of accessibility issues. The rest require human judgement, real assistive technology, and actual devices.</p><p>If your testing process begins and ends with Lighthouse, you’re signing off on work you haven’t properly checked.</p><h4>HTML validation</h4><p>This is the place to start. Invalid HTML can produce unexpected behaviour in the accessibility tree, and some errors that browsers silently correct visually will cause real problems for assistive technology.</p><p>The <a href="https://validator.w3.org/nu/">W3C Nu HTML Checker</a> is the right tool. Run it, read the output, and fix what it flags before moving on to anything else. It takes minutes and can help reduce a whole host of problems.</p><h4>Automated scanning</h4><p>Automated scanners are good at catching a specific class of problems like: missing alt text, incorrect contrast ratios, missing form labels, and duplicate IDs. Do run them, but understand what they’re <em>not </em>telling you.</p><p>Some tools to start with:</p><ul><li><a href="https://www.deque.com/axe/devtools/"><strong>axe DevTools</strong></a><strong> </strong>is the most reliable option. The browser extension is free and the results are precise, with low false positive rates.</li><li><a href="https://wave.webaim.org/"><strong>Web Accessibility Evaluation Tool</strong></a><strong> </strong>(WAVE) presents results directly in the page, which makes it easier to understand the context of each issue.</li><li><a href="https://developer.chrome.com/docs/lighthouse"><strong>Lighthouse</strong></a><strong> </strong>is built into Chrome DevTools and useful for a quick overview, but it catches fewer issues than axe and should be treated as a starting point rather than a sign-off tool.</li></ul><p>None of these tools will tell you whether your tab order makes sense, whether your error messages are helpful, whether your ARIA implementation actually works with a real screen reader, or whether your custom dropdown is navigable by keyboard. Ultimately, that’s your job.</p><h4>Semantic and structural review</h4><p>Look at your page without its styles. Disable CSS and check whether the content still has a logical order, whether the structure makes sense, and whether the hierarchy of headings holds up. If the unstyled page is confusing, then the markup needs attention.</p><p>Use the accessibility tree in browser DevTools to inspect individual elements. Check that roles, names, and states are what you expect. An element that looks correct visually may be announcing something entirely different to a screen reader. Never assume, and always check.</p><h4>Keyboard testing</h4><p>Put the mouse away, and navigate your entire build using only a keyboard. Try to tab through every interactive element. Activate buttons and links with <em>Enter</em> and <em>Space</em>. Open and close modals. Navigate dropdowns. Complete any forms, submit them with errors, and check what happens to focus.</p><p>Try to get keyboard focus trapped somewhere you can’t escape from. If you find something you can’t reach, can’t activate, or can’t get out of, that’s a failure. It needs fixing before anything ships.</p><h4>Screen reader testing</h4><p>This is the step most developers skip, and skipping it means you don’t actually know whether your markup is correct. A screen reader will expose problems that no automated tool will find and no visual check will surface.</p><p>You don’t need to be a fluent user, but you do need to be familiar enough to navigate a page, move through headings and landmarks, interact with forms and custom components, and understand what’s being announced.</p><p><strong><em>VoiceOver </em></strong>on macOS and iOS is built in and costs nothing. <strong><em>NVDA </em></strong>on Windows is free. Android offers <strong><em>TalkBack</em></strong>. Between them they cover the majority of real-world screen reader usage.</p><p>Test your build with the screen reader on. Navigate by headings and by landmarks. Tab through interactive elements and listen to what gets announced. Fill in a form, then trigger an error and check whether it’s communicated. Open a modal and check whether focus moves correctly.</p><p>These aren’t advanced tests. They’re the basics, and they will find things nothing else will.</p><h4>Real device testing</h4><p>Testing in a desktop browser, even with DevTools set to a mobile viewport, is not the same as testing on a real device.</p><ul><li>Touch target sizes that seem adequate on screen behave differently under an actual finger.</li><li>Screen readers on mobile operate differently to their desktop equivalents.</li><li>Landscape and portrait orientations can expose layout issues, content reflow problems, and interactions that break when the available space changes.</li></ul><p>So test on real devices. Test in portrait. Test in landscape. Check that content reflows correctly at different orientations without loss of information or functionality.</p><p>WCAG 1.3.4 requires that content isn’t restricted to a single display orientation unless it’s essential. That criterion is regularly failed by builds that were only ever tested on a fixed desktop viewport.</p><p>If you don’t have access to a wide range of physical devices, <a href="https://www.browserstack.com/"><strong><em>BrowserStack</em></strong></a> and similar services provide access to real device testing environments.</p><p>There’s no substitute for physical hardware, but it’s considerably better than DevTools alone.</p><h4>What good testing actually looks like</h4><p>Ensure your testing is not a checklist run at the end of a project. It needs to be something that happens as components are built, checked again when they’re integrated, and revisited when anything changes.</p><p>Accessibility doesn’t stay fixed. A content update, a new component, a third-party script added post-launch can all introduce new failures.</p><p>Testing needs to be part of how you work, not a gate before release. If you’re not doing all of this, you don’t know whether what you’ve built works. And if you don’t know whether it works, you’re not finished with the project or build.</p><h3>AI-generated code: know what you’re shipping</h3><p>This isn’t an argument against using AI tools. Most developers use them, and they’re genuinely useful for productivity, scaffolding, and working through problems quickly. They’re part of how we work now, and that’s not going to change.</p><p>The issue is specific: AI-generated code and accessibility don’t mix well without a developer who knows enough to catch what the tools get wrong. And they get <em>a lot</em> wrong.</p><p>The <a href="https://webaim.org/projects/million/">2026 WebAIM Million report</a> pointed to AI-assisted coding as a likely factor in the first reversal of accessibility progress in six years. That’s not a coincidence. AI tools are trained on the web as it exists, which is roughly 96% non-compliant, and the patterns they reproduce reflect that.</p><p>Common issues that appear in generated output are: deeply nested divs and spans, missing labels, ARIA applied incorrectly or unnecessarily, and focus management that was never considered. The markup looks plausible, passes a quick visual check, but it breaks the moment someone tries to navigate without a mouse.</p><p>The specific problem with AI-generated markup is that the failures tend to be invisible to automated tools. A role applied to the wrong element, a label that’s associated incorrectly, an ARIA attribute that contradicts the native semantics of the element it’s on.</p><p>These aren’t things <em>axe DevTools </em>or <em>Lighthouse </em>will reliably catch. They require someone who understands the accessibility tree, knows what correct markup looks like, and actually tests with assistive technology, and that person needs to be you.</p><p>Using an AI tool to scaffold a component and then reading, understanding, and properly testing what it produced is fine, but just copying or accepting generated output because it <em>looks right </em>is not.</p><p>The fact that a tool produced it doesn’t shift the responsibility. You’re the developer, and what ships is ultimately yours.</p><p>This applies equally to third-party component libraries and frameworks. The accessibility claims in a <em>README </em>are not a guarantee. Popular libraries ship with known accessibility issues that their maintainers are aware of and haven’t fixed. Check the issues list. Test the components yourself. Don’t assume that because something is widely used it’s been done correctly.</p><h3>Your role in the wider team</h3><p>Accessibility doesn’t arrive fully formed from a functional spec or a designer’s handover notes. It’s built, and that means the decisions you make during the build matter as much as anything that happened upstream.</p><p>But it also means you’re in a position to catch things other people missed, push back on things that won’t work, and be the person in the room who actually knows this stuff.</p><p>That’s not a small thing. On most teams, the developer is the only person who understands the accessibility tree, knows what semantic HTML does, and can look at a component and know whether it will work with a keyboard or a screen reader. That knowledge has value beyond your own output, so use it.</p><h4>Pushing back on designs</h4><p>If a design arrives with small fonts, icon-only buttons, insufficient contrast, or patterns that can’t be implemented accessibly, say so early. Not at handover, and not after you’ve built it.</p><p>The earlier a problem is raised, the cheaper it is to fix, and designers generally respond better to “<em>this won’t work for keyboard users, here’s why, so let’s work together on another approach</em>” than to a list of failures after sign-off.</p><p>You don’t need to reframe every conversation as an accessibility lecture. A straightforward observation is usually enough. “<em>This dropdown pattern doesn’t have a keyboard-accessible equivalent. How about we work on an alternative together?” </em>is a specific, actionable point. It’s easy to respond to, and it moves the conversation forward.</p><h4>Flagging inherited problems</h4><p>Sometimes you’ll be handed a brief, a design, or an existing codebase with accessibility problems already baked in. The temptation is to build what you’ve been given and let someone else deal with the consequences.</p><p>Flag what you find, and document it. Be clear about what the impact is and who it affects. If a decision is made to ship something you’ve flagged as a problem, make sure that’s a documented decision made by someone with the authority to make it, not something that quietly slips through because nobody wanted to have the conversation.</p><p>This matters for reasons beyond the professional. If a site ships with accessibility failures and a user is harmed or excluded as a result, <em>“I just built what I was given</em>” is not a defence that reflects well on anyone involved.</p><h4>Keeping up</h4><p>The accessibility landscape always changes. WCAG 2.2 introduced new criteria that many developers haven’t read, and WCAG 3.0 is in development. Browser support for accessibility features changes. Screen reader behaviour evolves. The legal context, as covered earlier, is always actively shifting.</p><p>Staying current doesn’t mean reading every spec as it’s published. It means treating accessibility as a professional discipline that requires ongoing attention, the same way you’d treat security, performance, or any other non-negotiable quality standard. Because that’s what it is.</p><h3>Where to go from here</h3><p>There’s real satisfaction in building something that works for users who’d otherwise have been left out. That’s worth enjoying, not just ticking off as a compliance step.</p><p>There’s no shortcut to getting good at this. It comes from reading, building, testing, and learning from mistakes over time. The resources below are hopefully a good starting point. Work through what’s relevant to what you’re building now, and keep coming back as your work changes.</p><h4>The essentials</h4><ul><li><a href="https://developer.mozilla.org/en-US/"><strong>MDN Web Docs</strong></a><strong> </strong>is the most useful day-to-day reference for HTML semantics, ARIA attributes, and accessibility-related CSS. If you’re unsure which element to use, or what an ARIA attribute actually does, start here before reaching for anything else.</li><li>The <a href="https://www.w3.org/WAI/ARIA/apg/"><strong>ARIA Authoring Practices Guide</strong></a><strong> </strong>(APG), published by the W3C, documents correct patterns for common interactive components. Dialogs, menus, tabs, accordions, carousels. It includes expected keyboard behaviour, correct roles and attributes, and working examples. Consult it before building custom components, not after.</li><li><a href="https://webaim.org/"><strong>WebAIM</strong></a><strong> </strong>has been publishing accessible web guidance for over twenty years. The contrast checker, the screen reader user surveys, and the introductory articles are all worth your time. The annual Million report is worth reading in full, not just the headline figures.</li><li>The <a href="https://www.w3.org/WAI/"><strong>W3C Web Accessibility Initiative</strong></a><strong> </strong>publishes the <a href="https://www.w3.org/TR/WCAG22/"><strong>WCAG documentation</strong></a>, along with supporting material that explains the intent behind each success criterion. <a href="https://www.w3.org/WAI/WCAG21/Understanding/understanding-techniques"><strong>Understanding Techniques for WCAG 2.1 Success Criteria</strong></a><strong> </strong>and <a href="https://www.w3.org/WAI/WCAG22/Understanding/"><strong>Understanding WCAG 2.2</strong></a><strong> </strong>are both more readable than the spec itself and help translate the criteria into practical decisions.</li></ul><h4>Screen readers</h4><ul><li><em>VoiceOver </em>is built into macOS and iOS, and Android offers <em>TalkBack. </em>Give them a try and learn the basic navigation commands, and use them regularly on your own work.</li><li><a href="https://www.nvaccess.org/"><em>NVDA</em></a><em> </em>is free for Windows and is one of the most widely used screen readers in the world.</li><li><a href="https://vispero.com/jaws-screen-reader-software/"><em>JAWS</em></a><em> </em>is the most commonly used screen reader in enterprise and government contexts but requires a licence.</li></ul><p>Between these, you’ll cover the majority of real-world usage.</p><h4>Testing tools</h4><ul><li><strong>axe DevTools </strong>browser extension for reliable automated scanning.</li><li><strong>WAVE </strong>as a visual complement.</li><li>The <strong>W3C Nu HTML Checker </strong>for markup validation.</li><li>The browser’s <strong>Developer Tools: Accessibility panel </strong>for inspecting the accessibility tree directly.</li><li><strong>BrowserStack </strong>or a physical device collection for real device testing.</li></ul><h4>Going further</h4><p><a href="https://inclusive-components.design/">Heydon Pickering’s Inclusive Components</a> is a practical, component-level guide to building accessibly. It’s still relevant, very detailed, and written by someone with years of experience in the field.</p><p>I’ve listed a range of people and groups whose work I admire and who write outstanding accessibility articles. If you want to understand why things work the way they do, rather than just what to do, their articles are well worth reading.</p><h3>Resources</h3><h4><strong>Part of a series</strong></h4><p>This is one of three articles looking at web accessibility from a different role in the team. If you work alongside project managers or account handlers, <a href="https://medium.com/@sturit/web-accessibility-for-the-rest-of-the-team-ab74134ef0a3">Web accessibility for the rest of the team</a> covers what non-technical roles can do at each stage of a project. If you work with designers, <a href="https://medium.com/@sturit/good-design-works-for-everyone-b98403b4c3c7">Good design works for everyone</a> covers the same ground from a UX and UI perspective.</p><p><strong>WebAIM</strong></p><ul><li>WebAIM site: <a href="https://webaim.org/">https://webaim.org</a></li><li>The Million Report: <a href="https://webaim.org/projects/million">https://webaim.org/projects/million</a></li><li>Contrast checker: <a href="https://webaim.org/resources/contrastchecker">https://webaim.org/resources/contrastchecker</a></li></ul><p><strong>W3C / WAI</strong></p><ul><li>Web Accessibility Initiative: <a href="https://www.w3.org/WAI">https://www.w3.org/WAI</a></li><li>WCAG 2.2: <a href="https://www.w3.org/TR/WCAG22">https://www.w3.org/TR/WCAG22</a></li><li>Understanding WCAG 2.2: <a href="https://www.w3.org/WAI/WCAG22/Understanding">https://www.w3.org/WAI/WCAG22/Understanding</a></li><li>ARIA Authoring Practices Guide: <a href="https://www.w3.org/WAI/ARIA/apg">https://www.w3.org/WAI/ARIA/apg</a></li><li>Nu HTML Checker: <a href="https://validator.w3.org/nu">https://validator.w3.org/nu</a></li></ul><p><strong>MDN</strong></p><ul><li>Accessibility docs: <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility">https://developer.mozilla.org/en-US/docs/Web/Accessibility</a></li><li>HTML elements reference: <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element">https://developer.mozilla.org/en-US/docs/Web/HTML/Element</a></li><li>ARIA reference: <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA">https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA</a></li></ul><p><strong>Screen readers</strong></p><ul><li>NVDA: <a href="https://www.nvaccess.org/">https://www.nvaccess.org</a></li><li>JAWS: <a href="https://www.freedomscientific.com/products/software/jaws">https://www.freedomscientific.com/products/software/jaws</a></li><li>VoiceOver: <a href="https://www.apple.com/accessibility/vision">https://www.apple.com/accessibility/vision</a></li><li>TalkBack: <a href="https://support.google.com/accessibility/android/answer/6283677">https://support.google.com/accessibility/android/answer/6283677</a></li></ul><p><strong>Testing tools</strong></p><ul><li>axe DevTools: <a href="https://www.deque.com/axe/browser-extensions">https://www.deque.com/axe/browser-extensions</a></li><li>WAVE: <a href="https://wave.webaim.org/">https://wave.webaim.org</a></li><li>BrowserStack: <a href="https://www.browserstack.com/">https://www.browserstack.com</a></li><li>Silktide Inspector: <a href="https://chromewebstore.google.com/detail/mpobacholfblmnpnfbiomjkecoojakah?utm_source=item-share-cb">https://chromewebstore.google.com/detail/mpobacholfblmnpnfbiomjkecoojakah</a></li><li>Vially Inspector: <a href="https://chromewebstore.google.com/detail/omeaffchkbmlnincefdgjajijodnobbb?utm_source=item-share-cb">https://chromewebstore.google.com/detail/omeaffchkbmlnincefdgjajijodnobbb</a></li></ul><p><strong>People, groups, and resources</strong></p><ul><li>Heydon Pickering’s Inclusive Components: <a href="https://inclusive-components.design/">https://inclusive-components.design</a></li><li>Sara Soueidan: <a href="https://www.sarasoueidan.com/">https://www.sarasoueidan.com/</a></li><li>Adrian Roselli: <a href="https://adrianroselli.com/">https://adrianroselli.com/</a></li><li>Hidde de Vries: <a href="https://hidde.blog/">https://hidde.blog/</a></li><li>Manuel Matuzović: <a href="https://www.matuzo.at/blog">https://www.matuzo.at/blog</a></li><li>Scott O’Hara: <a href="https://www.scottohara.me/">https://www.scottohara.me/</a></li><li>Eric Bailey: <a href="https://ericwbailey.website/">https://ericwbailey.website/</a></li><li>Eric Eggert: <a href="https://yatil.net/">https://yatil.net/</a></li><li>Karl Groves: <a href="https://karlgroves.com/">https://karlgroves.com/</a></li><li>Stephanie Walter: <a href="https://stephaniewalter.design/blog/">https://stephaniewalter.design/blog/</a></li><li>TetraLogical: <a href="https://tetralogical.com/blog/">https://tetralogical.com/blog/</a></li><li>a11y weekly newsletter: <a href="https://a11yweekly.com/">https://a11yweekly.com/</a></li><li>Deque blog: <a href="https://www.deque.com/blog/">https://www.deque.com/blog/</a></li><li>Vispero blog: <a href="https://vispero.com/resources/category/blog/">https://vispero.com/resources/category/blog/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c655cbf0c31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Good design works for everyone]]></title>
            <link>https://sturit.medium.com/good-design-works-for-everyone-b98403b4c3c7?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b98403b4c3c7</guid>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 06:36:46 GMT</pubDate>
            <atom:updated>2026-07-02T15:46:47.933Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical introduction to accessibility for UX and UI designers.</h4><figure><img alt="Two designers working at a laptop" src="https://cdn-images-1.medium.com/max/1024/0*LBoBnRJqaZkn8g8W" /><figcaption>Photo by <a href="https://unsplash.com/@kobuagency?utm_source=medium&amp;utm_medium=referral">KOBU Agency</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Everyone should be involved</h3><p>Designers are often left out of accessibility conversations or brought in late, expected to fix things after the fact. But many of the most important decisions happen long before any code is written. The design stage is where some of the most meaningful changes can be made, and where a more inclusive product starts to take shape, long before it reaches a developer.</p><p>This article is for anyone working in UX, UI, or visual design: whether you’re in Figma, sketching wireframes, or mapping full user journeys.</p><p>Accessibility works best as a shared responsibility across the whole team. The more you can bring others into those conversations early, the better. You don’t need to be a WCAG expert to make more inclusive choices. You just need to know where to look, and what to do when you find something worth questioning.</p><h4><strong>Accessibility doesn’t kill creativity</strong></h4><p>A lot of designers assume accessibility and creativity pull in opposite directions. Dull colours, oversized fonts, no room to experiment. That fear makes sense, but only when “accessible” gets mistaken for “safe” or worse, “boring”.</p><p>It’s important to remember that creativity isn’t about doing something radical for the sake of it. It’s about solving problems in ways that actually work for people. Accessibility is part of that. A design that holds up when zoomed in, translated into another language, or navigated with a keyboard — that’s not a compromise. That’s design doing its job.</p><p>This is the thinking behind <strong>Universal Design</strong>: designing from the outset for the full range of people who might use something, rather than treating different needs as edge cases to fold in later. If you want to explore it further, the <a href="https://universaldesign.ie/"><strong>Centre for Excellence in Universal Design</strong></a><strong> </strong>is a good starting point.</p><p>And it’s worth being direct about what the alternative looks like: design that excludes a significant portion of your users isn’t a niche problem. It’s just bad design.</p><p>Try reframing the constraints. Designing for a wider range of devices, abilities, and environments tends to bring about better ideas, not fewer of them. Most designers who approach it that way don’t look back.</p><h3>Kick-off: consider accessibility early</h3><p>Some of the most important accessibility conversations happen before a single component is designed. If it doesn’t come up at the start, it tends to get pushed back until it’s too late (or too expensive) to fix.</p><p><strong>What to do:</strong></p><ul><li>Be an advocate. Raise accessibility from day one, not as an afterthought but as part of the brief.</li><li>Ask what WCAG compliance level the project needs to meet. WCAG 2.2 AA should be the baseline unless told otherwise.</li><li>Check that personas and user journeys reflect a range of people — including those who navigate differently, use assistive technology, or have higher cognitive load.</li><li>If the project is using a design system or UI library, check it has solid, well-tested accessibility foundations before committing to it.</li></ul><p><strong>What to flag:</strong></p><ul><li>Tight timelines that leave no room for testing or iteration.</li><li>Projects that treat accessibility as a developer’s problem, or something to review just before launch.</li><li>Stakeholders who assume ‘our users won’t need this’.</li></ul><h3>During design…</h3><p>Your choices around typography, layout, colour, and component structure have a direct effect on how accessible a design ends up being. Getting these right early avoids a lot of rework further down the line.</p><p>It’s also worth talking to front-end developers early and not just at handover. They’ll often spot feasibility issues before they become problems, and some of the best solutions come out of those conversations.</p><h4>Typography</h4><p>Typography decisions affect far more people than most designers expect, and not just users with visual impairments, but anyone reading on a cheaper display, in bright sunlight, or while tired.</p><p><strong>What to check:</strong></p><ul><li><strong>Don’t go below 12pt / 16px</strong>. Smaller text becomes difficult to read on many devices, particularly for users with low vision or when the page is zoomed.</li><li><strong>Aim for a line height of 1.5–1.6</strong>. This gives the eye enough space to move from one line to the next without losing its place.</li><li><strong>Avoid light grey or very thin fonts for body text</strong>. Low contrast and ultra-light weights make reading harder, especially on lower-quality displays.</li><li><strong>Keep line lengths to around 65–75 characters</strong>. Longer lines make it harder to track back to the start of the next one.</li><li><strong>Don’t use all caps for body text or long phrases</strong>. It slows reading down and tends to read as shouting.</li><li><strong>Be cautious with rotated or diagonal text</strong>. Vertical text can be disorienting, and in some languages it breaks reading flow entirely.</li></ul><h4><strong>Spacing and white-space</strong></h4><p>White-space isn’t decoration. The space around and between elements has a direct effect on how readable and usable a design is, particularly for users with cognitive differences, low vision, or motor impairments.</p><p><strong>What to check:</strong></p><ul><li><strong>Give interactive elements enough breathing room </strong>that they don’t feel crowded. Buttons and inputs that sit too close together are harder to tap accurately and harder to scan quickly.</li><li><strong>Don’t pack text tightly </strong>against the edges of containers. Insufficient padding makes content harder to read, especially on small screens.</li><li><strong>Use consistent spacing </strong>to group related content visually. When spacing is arbitrary, the hierarchy becomes harder to read, and harder for a developer to implement cleanly.</li><li><strong>Be cautious with very dense layouts</strong>. What looks considered in a desktop mockup can become overwhelming on a smaller screen or for someone who finds busy interfaces harder to process.</li></ul><h4>Colour and contrast</h4><p>Poor contrast is one of the most common accessibility failures in design, and is one of the easiest to miss, because it can look fine on a good monitor in a well-lit room.</p><p><strong>What to check:</strong></p><ul><li><strong>Run contrast checks on all text</strong>, including text over background images, videos, or gradient blocks. What looks readable on your screen may not hold up on cheaper displays or in bright conditions.</li><li><strong>Follow WCAG minimum contrast ratios</strong>: 4.5:1 for normal text, 3:1 for larger text and input borders. These aren’t arbitrary numbers — they reflect what people with low vision or colour blindness need to read and interact comfortably.</li><li><strong>Don’t use colour alone to convey meaning</strong>. Pair it with an icon, a label, or both. A red error message means nothing to someone who can’t distinguish red from grey.</li><li><strong>Design focus indicators with contrast in mind</strong>. WCAG 2.2 introduced a minimum focus appearance requirement, with the focus indicator itself needs a contrast ratio of at least 3:1 against the surrounding area. A faint or barely-there outline isn’t enough. If you’re designing focus states (and you should be), check them the same way you’d check text contrast.</li><li><strong>Consider how your palette holds up in forced colour modes</strong>. <em>Windows High Contrast </em>mode and similar user overrides replace your colour choices entirely with a limited system palette. Designs that rely heavily on subtle colour differences, background images, or low-contrast detail can fall apart in these modes. It’s worth testing, and worth flagging to the developers so they can handle it at the code level too.</li></ul><h4>Buttons, links, and touch targets</h4><p>If something is interactive, users need to be able to find it, reach it, and activate it, regardless of how they’re navigating.</p><p><strong>What to check:</strong></p><ul><li><strong>Aim for a minimum touch target size of 24 x 24px for WCAG AA</strong>, and 44 x 44px for AAA. Larger targets reduce accidental taps, which matters on mobile and for anyone with limited dexterity.</li><li><strong>If you’re designing hover states, design focus states too</strong>. Keyboard users depend on visible focus indicators to know where they are — without them, navigation becomes trial and error.</li><li><strong>Text links should be distinguishable from body text </strong>by more than colour alone. Underlines are the clearest signal. Users with colour blindness may not spot a difference between a blue link and dark grey body text.</li><li><strong>Icon-only buttons need a visible label</strong>. We’ll cover this in the next section.</li></ul><h4>Icons and visual context</h4><p>Icons can help with navigation and reinforce meaning, but take away the context and they stop working. That’s true for anyone new to an interface. For screen reader users, an icon with no label or text alternative may provide nothing useful at all.</p><p><strong>What to check:</strong></p><ul><li><strong>Always pair icons with a text label</strong>. This applies to navigation, actions, and anything interactive. An icon alone is an assumption about what the user already knows.</li><li><strong>Don’t build navigation that relies entirely on icons</strong>, particularly on mobile. What feels intuitive in a design tool can be genuinely unclear to someone encountering it for the first time.</li><li><strong>Avoid menus or toolbars where every option is icon-only</strong>. A row of small symbols with no text is rarely as self-explanatory as it looks in a mockup.</li></ul><h4>Navigation and layout</h4><p>Users shouldn’t have to figure out how to get around. Navigation that works is navigation people don’t notice.</p><p><strong>What to check:</strong></p><ul><li><strong>Use clear headings and a consistent layout</strong>. A familiar structure lets users orient themselves quickly without having to think too hard about it.</li><li><strong>On multilingual sites, check that navigation can accommodate longer translated text</strong>. Some languages expand considerably, and navigation that looks clean in English can break or hide links in others.</li><li><strong>Be cautious with large multi-tier mega menus</strong>. They’re often difficult to navigate with a keyboard, and on mobile they can become a real obstacle. What looks comprehensive in a mockup can quickly become a barrier in practice.</li><li><strong>Don’t default to off-canvas or hidden menus on desktop</strong>. That pattern has its place on mobile, but hiding navigation behind an extra step on larger screens adds friction without much benefit.</li></ul><h4>Motion and animation</h4><p>Animation can add polish and help communicate state changes, but for some users it causes real problems. Vestibular disorders, epilepsy, and certain cognitive differences can make heavy motion uncomfortable, disorienting, or in some cases dangerous.</p><p>This is also an area where a front-end developer needs to be involved early, not handed a finished spec and left to work it out.</p><p><strong>What to check:</strong></p><ul><li><strong>Large-scale motion, parallax effects, and animations that play automatically should be used with caution</strong>. A developer can make sure these respond correctly to user settings and can be paused or stopped where needed, so work with them.</li><li><strong>The <em>prefers-reduced-motion </em>query lets users signal through their browser or OS that they want less motion</strong>. A developer can write CSS and JavaScript that respects this, but they need to know which animations exist and what a reduced or static alternative should look like.</li><li><strong>Flashing or rapidly strobing content is problematic</strong>. Anything that flashes more than three times per second can trigger seizures. It shouldn’t reach production in any form.</li><li><strong>Use animation purposefully</strong>. Transitions should communicate something: a state change, a relationship between elements, a direction of travel. The more decorative or subtle an animation is, the easier it is to reduce without losing anything.</li><li><strong>When handing off animated components, document the intended behaviour clearly </strong>and include notes on what the reduced-motion version should do. Assuming a developer will work it out from the full animation alone is where things tend to go wrong.</li></ul><p><strong>Important</strong>: It’s best to work with a front-end developer to build animations properly in the browser - they can make them performant, accessible, and responsive to user preferences in ways a design tool simply can’t.</p><p>It’s worth setting expectations with clients early too: <strong>animations shown in a Figma prototype are indicative only</strong>. What gets built may look and behave differently, that’s not a failing, it’s just how browser animation works.</p><h4>Forms and inputs</h4><p>Forms are where accessibility problems tend to pile up, and many of them start at the design stage. Poor labelling, buried instructions, and unclear error handling can all create barriers before a developer has written a single line of code.</p><p><strong>What to check:</strong></p><ul><li><strong>Every input needs a visible, associated label</strong>. Placeholder text doesn’t count. Without a proper label, screen readers have no reliable way to tell users what a field is for.</li><li><strong>Show instructions clearly, not tucked behind tooltips or info icons</strong>. If a user has to go hunting for guidance, the form is already harder than it needs to be.</li><li><strong>Use plain language and group related fields together</strong>. Forms that are logically structured and simply worded are easier to complete for everyone.</li><li><strong>Mark required fields with text, not just a red asterisk or colour cue</strong>. Something like “Email address (required)” leaves no room for ambiguity.</li><li><strong>Be careful with placeholder text</strong>. It disappears the moment a user starts typing, it’s often too low-contrast to read comfortably, and it should never substitute for a proper label.</li><li><strong>Avoid modal or pop-up forms where possible</strong>. They can be difficult to navigate with a keyboard, awkward on small screens, and in some cases completely inaccessible to screen reader users.</li><li><strong>Design an error summary pattern for longer forms</strong>. When validation fails, a list of errors at the top of the form with each one linking to the relevant field. This is much easier to deal with than hunting through the page for individual inline messages.</li></ul><h4>Managing client expectations</h4><p>Sometimes you’ll need to push back. A client might request something you know causes problems, favour a trend that doesn’t hold up, or simply not realise a design choice has accessibility implications. Part of the job is helping them understand why it matters, and offering a way forward that still works for them.</p><p><strong>What to do:</strong></p><ul><li><strong>Be ready to explain the reasoning in plain terms</strong>. Something like: “This icon needs a label. On its own, it’s not clear enough what it does.”</li><li><strong>Offer alternatives rather than just saying no</strong>. If brand colours don’t meet contrast requirements online, suggest building a web-friendly version of the palette that stays true to the brand. Most clients respond better to options than objections.</li><li><strong>If a client assumes accessibility means dull design, show them examples that prove otherwise</strong>. Find a few well-designed, genuinely accessible sites that fit their sector or aesthetic and have them ready.</li><li><strong>If you’re told to copy a competitor’s site, check whether it’s actually accessible first</strong>. If it isn’t, that’s a reason to suggest a better approach, and not a reason to replicate the problem.</li><li><strong>Push back on brand font or size choices that risk readability online</strong>. A typeface that works in print can be too thin, too small, or simply not suited to screens.</li></ul><h4>Responding to feedback</h4><p>If your work is reviewed by accessibility testers or advocates, some of the feedback might feel at odds with your design intentions. That’s normal.</p><p><strong>What to do:</strong></p><ul><li><strong>Treat feedback as refinement, not criticism</strong>. The goal is a better experience for more users.</li><li><strong>If you’re not sure why something has been flagged, try it yourself</strong>. Find a similar example online and navigate it with a keyboard, or run a screen reader on your own designs. It’s a quick way to understand what the problem actually feels like.</li><li><strong>If feedback clashes with your design direction, work towards alternatives rather than dismissing it</strong>. There’s usually a version of what you’re trying to achieve that doesn’t create a barrier.</li><li><strong>If the rationale isn’t clear, ask for it</strong>. Accessibility guidance should be explainable in plain terms, and it’s reasonable to expect that.</li><li><strong>If something genuinely can’t be changed, document why</strong>. Be honest about the trade-offs, and flag it to whoever manages the client relationship. Not every issue gets resolved in one round, but being transparent about the limitations is better than pretending they don’t exist.</li></ul><h3><strong>Design-to-code tools: a word of caution</strong></h3><p>There are more tools than ever promising to turn your Figma designs into working code. Plugins, SaaS platforms, Figma Sites, AI tools — the pitch is always the same: faster output, less dependency on developers. The reality is messier.</p><p>These tools have their place in prototyping and personal projects. For production work, the caveats are significant.</p><p><strong>What to know:</strong></p><ul><li><strong>Many don’t generate semantic HTML</strong>. Headings, landmarks, and proper document structure are often missing or wrong, which means screen readers and keyboard users may have no reliable way to navigate the content.</li><li><strong>Interactive elements like modals and drop-downs frequently lack keyboard support</strong>. If something can only be operated with a mouse, it’s broken for a portion of your users.</li><li><strong>The code output is often bloated and hard to maintain</strong>, which makes future updates more difficult and increases the chance of introducing further issues.</li><li><strong>Designers using these tools rarely have visibility of the technical problems they create</strong>. What looks fine in a browser preview can be a complete mess underneath.</li><li><strong>Don’t accept marketing claims </strong>about “clean code” or “accessibility out of the box” at face value.</li></ul><p><strong>What to flag:</strong></p><ul><li>Clients or stakeholders who expect design-to-code tools to replace a proper build phase. Right now, they can’t.</li><li>Any plan to handover directly from a Figma plugin without developer involvement. A plugin is not a substitute for a front-end developer who understands accessibility.</li></ul><p>Kevin Powell’s video: <a href="https://www.youtube.com/watch?v=ZsFIvULxkHI&amp;ab_channel=KevinPowell"><em>Figma Sites is worse than you might have thought</em></a> is worth watching if you want a concrete example of what these tools actually produce under the hood.</p><p>Its also worth noting that <a href="https://webaim.org/projects/million/">the 2026 WebAIM Million</a> report found accessibility failures on the web went up for the first time in years, and pointed to AI-generated code as a likely factor.</p><p>So, if you want your designs to become accessible websites, the current best options are: learn HTML, CSS, and JavaScript, or work closely with a developer who already has.</p><h3><strong>Before handover: a quick reference</strong></h3><p>By the time you’re ready to handover, a lot of the decisions that affect accessibility have already been made. This isn’t a substitute for the detail in each section above, it’s a reminder of the things most likely to cause problems if they haven’t been checked.</p><p><strong>Typography and spacing:</strong></p><ul><li>Body text is at least 16px with a line height of 1.5 or above</li><li>Line lengths sit around 65–75 characters</li><li>Spacing around interactive elements is generous enough to tap accurately</li></ul><p><strong>Colour and contrast:</strong></p><ul><li>All text passes contrast checks, including text over images or gradients</li><li>Colour is never the only way meaning is conveyed</li><li>Focus indicators have been designed and meet the 3:1 contrast requirement</li></ul><p><strong>Interaction and navigation:</strong></p><ul><li>Every interactive element has a visible focus state</li><li>Icon-only buttons have a text label</li><li>Touch targets meet the minimum size requirement</li><li>Reading order has been considered and noted for anything visually complex</li></ul><p><strong>Forms:</strong></p><ul><li>Every input has a visible label (not a placeholder)</li><li>Required fields are marked with text</li><li>Error states are designed, including an error summary for longer forms</li></ul><p><strong>Motion:</strong></p><ul><li>Work with a front-end developer on final animations</li><li>Animated components have a documented reduced-motion alternative</li><li>Nothing flashes more than three times per second</li></ul><p><strong>Handover notes:</strong></p><ul><li>Intended reading order is documented for complex layouts</li><li>Any known constraints or trade-offs are flagged rather than left for the developer to discover</li></ul><h3>Conclusion</h3><p>Accessibility isn’t something you address before a project goes live. It comes from decisions made all the way through: in the brief, the wireframe, the colour palette, the UI library. A lot is decided before it ever reaches the browser, which is why it matters so much at the design stage.</p><p>You don’t need to be a WCAG expert to notice when something might cause a problem. You just need to know what to look for, and be willing to say something when you find it.</p><p>A follow-up article in the works will cover common UI pitfalls such as carousels, disclosure blocks, scroll hijacking. This is where design and development decisions can create real problems if they’re not thought through carefully.</p><p>This is one of three articles covering accessibility across different roles. If you work with project managers or account handlers, <a href="https://medium.com/@sturit/web-accessibility-for-the-rest-of-the-team-ab74134ef0a3">the non-technical team guide</a> covers what they can do at each stage of a project. A developer-focused introduction is in the works too.</p><h4>Resources, References &amp; Tools</h4><ul><li><a href="https://www.w3.org/WAI/WCAG22/quickref/">WCAG 2.2 Guidelines</a></li><li><a href="https://webaim.org/resources/contrastchecker/">WebAIM Contrast Checker</a></li><li><a href="https://www.w3.org/WAI/tips/designing//">Designing for Web Accessibility</a></li><li><a href="https://universaldesign.ie/about-universal-design/the-7-principles">The 7 Principles of Universal Design</a></li><li><a href="https://www.youtube.com/watch?v=ZsFIvULxkHI&amp;ab_channel=KevinPowell">Figma Sites is worse than you might have thought</a></li><li><a href="https://universaldesign.ie/">Centre for Excellence in Universal Design</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b98403b4c3c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web accessibility for the rest of the team]]></title>
            <link>https://sturit.medium.com/web-accessibility-for-the-rest-of-the-team-ab74134ef0a3?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab74134ef0a3</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Tue, 05 May 2026 06:25:18 GMT</pubDate>
            <atom:updated>2026-07-02T14:36:00.227Z</atom:updated>
            <content:encoded><![CDATA[<h4>A basic guide for non-technical roles</h4><figure><img alt="A person planning using a laptop, post-it notes, and a calendar" src="https://cdn-images-1.medium.com/max/1024/0*H-YBWUK0f2AG44iU" /><figcaption>Photo by <a href="https://unsplash.com/@martenbjork?utm_source=medium&amp;utm_medium=referral">Marten Bjork</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Accessibility: it isn’t just a developer’s job</h4><p>If you manage or shape a digital project but don’t write the code, accessibility probably doesn’t feel like your responsibility. It is, though - more than you might think.</p><p>Accessibility tends to get filed under “developer’s job” - something handled through feasibility checks, mark-up, and styling. But most accessibility problems don’t start in the code. They start much earlier, when nobody raises the subject at all.</p><p>You don’t need to know WCAG inside-out or be fluent in assistive tech. Many of the most useful things you can do happen long before anyone touches the code.</p><p>This article is for anyone involved in shaping or delivering a project -project managers, account handlers, content people. It’s a beginner’s guide, not an exhaustive one. The goal is to give you a starting point: practical things you can look out for at each stage, without needing a technical background to act on them.</p><h4>What is WCAG?</h4><p>WCAG - the <strong>Web Content Accessibility Guidelines</strong> - is an internationally recognised standard for web accessibility, organised into three levels: A, AA, and AAA. Most projects aim for AA. Having it referenced explicitly gives the whole team a shared benchmark rather than leaving “accessible” open to interpretation.</p><p>It’s also worth knowing the legal context, and being aware that it varies depending on where your client operates.</p><p>In the UK, the <a href="https://www.legislation.gov.uk/ukpga/2010/15/contents"><strong>Equality Act 2010</strong></a><strong> </strong>requires that services are accessible to people with disabilities, and that includes websites. Public sector organisations have additional obligations under the <a href="https://www.legislation.gov.uk/uksi/2018/952/contents"><strong>Public Sector Bodies Accessibility Regulations 2018</strong></a>, which set stricter requirements around compliance statements and testing.</p><p>In Ireland and across the EU, the <a href="https://commission.europa.eu/strategy-and-policy/policies/justice-and-fundamental-rights/disability/european-accessibility-act-eaa_en"><strong>European Accessibility Act</strong></a><strong> </strong>came into force in 2025, extending accessibility requirements beyond the public sector to a wide range of commercial products and services for the first time. For any client operating in the EU, this is increasingly relevant and worth raising early.</p><p>In the US, the <a href="https://www.ada.gov/"><strong>Americans with Disabilities Act</strong></a><strong> </strong>(ADA) has long covered website accessibility, but April 2026 marks a significant shift. The Department of Justice finalised a new rule in 2024 that - for the first time - sets a specific technical standard for digital content: WCAG 2.1 Level AA. This applies to state and local government entities serving populations of 50,000 or more, with smaller public bodies following (note: compliance date was recently extended to April 26 2027).</p><p><strong>Section 508 </strong>continues to set separate requirements in the US for federal agencies and their procurement. While the rule targets public entities directly, it has knock-on implications for private businesses supplying digital products or services to government organisations.</p><p>So, enforcement varies by region, and the specifics can get complicated, and if a client has questions about their exact obligations, it’s worth involving someone with relevant legal knowledge.</p><p>It’s also worth knowing that meeting a technical standard like WCAG isn’t always the whole picture. Many regions have additional requirements on top of technical compliance - <strong>accessibility statements </strong>published on the site, documented testing processes, named contacts for reporting issues, and in some cases formal remediation plans. These aren’t optional extras in the regions where they apply, and they’re easy to overlook if the conversation stays focused on code and design alone.</p><p>The trend is consistent regardless of region: <strong>accessibility is now an expectation, not an optional extra</strong>. Most clients respond better to that framing than to a purely technical argument - particularly when you can point to real deadlines and legal obligations rather than just good practice.</p><h4>Kick-off: set expectations and ask the right questions</h4><p>Accessibility needs to be in the room from day one - briefs, requirement sessions, kick-off meetings. Waiting until QA to raise it, or worse, once a site has gone live, means fixing problems under pressure, which takes longer and costs more.</p><p>A common version of this: a site reaches final testing and someone notices the colour contrast fails across the whole UI system. The palette has to be revisited, components amended, and the timeline slips. It’s a fixable problem - but at that stage, it’s an expensive one. Raised at the design brief, it’s a five-minute conversation.</p><p><strong>What to do:</strong></p><ul><li><strong>Raise accessibility as a requirement early</strong>, and explain why it matters. It signals to the client that quality and inclusion are part of how you work, not an afterthought.</li><li><strong>Make sure WCAG compliance is part of the project’s quality expectations</strong>. It gives the whole team a shared benchmark for what “accessible” actually means.</li><li><strong>Check that timelines include room for proper testing </strong>at each stage - design, front-end, pre-go-live. Rushed testing is where accessibility issues get missed or caught too late to fix cleanly.</li><li><strong>Encourage clients to think beyond legal compliance</strong>. Accessibility improves usability for everyone - it’s not just about avoiding risk.</li></ul><p><strong>What to flag:</strong></p><ul><li>Any suggestion that accessibility is “extra” or something to revisit later.</li><li>Timelines with no space for feedback or iteration.</li><li>Clients assuming their users won’t need accessible features - as they often don’t know who their users are.</li><li>Projects with no defined QA or review phase.</li><li>Teams planning to rely on automated tools alone - these catch some issues, but miss a lot.</li></ul><h4>During content planning</h4><p>Content decisions made early in a project can create accessibility problems that are hard to unpick later. Structure, media choices, and language all matter - and they’re much easier to get right before anything is built.</p><p><strong>What to check:</strong></p><ul><li><strong>Are headings being planned in a logical order </strong>- H1, H2, H3 and so on? Headings aren’t just visual. Screen reader users often navigate a page by heading alone, so a broken or skipped hierarchy makes that much harder.</li><li><strong>Is any important content going to live only inside an image </strong>- infographics, for example? If so, there needs to be a text equivalent. Users who can’t see the image will miss the information entirely.</li><li><strong>Are animations or auto-playing videos planned? </strong>Think about whether they loop, flash, or play without warning. Movement should be optional where possible, and anything that flashes rapidly can trigger seizures.</li><li><strong>Are transcripts and descriptions being planned for video and audio content? </strong>They help users who can’t see or hear the media - and they’re good for SEO too.</li><li><strong>Is important content hidden by default? </strong>Disclosure patterns aren’t always a problem, but if critical information only exists behind a click - and there’s no clear reason for it to be collapsed - some users will miss it entirely, and others will find it harder to navigate.</li></ul><p><strong>What to flag:</strong></p><ul><li>Placeholder content that could easily slip through to launch. Push for real content from the client as early as possible - it makes everything easier to review properly.</li><li>Overly complex or jargon-heavy language where plain alternatives would do.</li><li>Key information sitting in PDFs or Word documents rather than web pages. These often have their own accessibility issues and are harder to maintain.</li><li>Video or audio with no plan for captions or transcripts.</li><li>Images with no discussion of alternative text - this should be part of the content plan, not an afterthought at development stage.</li><li>It’s worth questioning whether the content structure - especially hidden content - is serving the user or just keeping the page tidy.</li></ul><h4>During design and development</h4><p>You don’t need a design or development background to spot when something looks hard to read, hard to tap, or hard to understand. A fresh pair of eyes at this stage can catch things the people closest to the work have stopped seeing.</p><p><strong>What to check:</strong></p><ul><li><strong>Is the text large enough to read comfortably, including on smaller screens? </strong>If someone has to zoom in to read body copy, that’s a problem worth raising.</li><li><strong>Is the colour contrast strong enough? </strong>Tools like WebAIM’s Contrast Checker or the Silktide browser extension make this quick to check — low contrast is one of the most common issues and one of the easiest to miss.</li><li><strong>Are buttons and interactive elements large enough to tap accurately on a touch device? </strong>Small targets are a common complaint, and easy to flag early.</li><li><strong>Do links and interactive elements have visual cues beyond colour </strong>- underlines, labels alongside icons, that sort of thing? Colour alone isn’t enough for users with colour vision differences.</li><li><strong>Are any links or calls-to-action vague - “click here”, “read more”, “find out more”? </strong>Link text should make sense without any surrounding context.</li><li><strong>Where text sits over an image background, is the contrast still readable?</strong> Busy or light backgrounds can make text difficult to read even if it technically passes contrast checks elsewhere.</li><li><strong>Do videos auto-play? Do carousels rotate automatically? </strong>Users should have control over movement - auto-playing content can be disorienting and, in some cases, cause real distress.</li><li><strong>Can you tab through every interactive element on the page and see a clear focus indicator</strong>? Try it. Keyboard users depend on this, and it’s one of the most commonly overlooked issues.</li><li><strong>Ask if it was built with AI-generated markup.</strong> AI tools can produce markup that looks thorough but is semantically wrong in ways automated testing won’t catch. Currently, hand-crafted UI built by someone who understands the accessibility tree is still the more reliable approach.</li></ul><p><strong>What to flag:</strong></p><ul><li>Low-contrast colour choices or very light text.</li><li>Interactions that only work on hover - these don’t translate to touch devices at all.</li><li>Complicated interface patterns where it’s not obvious what a user is supposed to do.</li><li>Forms with no visible labels, or buttons that use icons only with no text alternative.</li><li>Vague link text like “click here” or “read more”.</li><li>Any plan to ship AI-generated markup without a human review phase needs revisiting.</li></ul><h4>During testing and sign-off</h4><p>Some accessibility issues will have been baked in long before testing starts. That’s not a reason to skip checks at this stage - it’s a reason to be thorough. Even basic manual testing picks up problems that automated tools won’t catch.</p><p>One of the steps below involves <strong>navigating with a keyboard only</strong>. A quick way to understand why this matters: open any website and put your mouse to one side. Try to access the main navigation (especially if it has a mega-menu), or get through a contact form, or close a cookie banner, using only the keyboard. It takes about thirty seconds to discover whether it works - and on a lot of sites, it doesn’t. That’s the experience some users have every time.</p><p><strong>What to do:</strong></p><ul><li><strong>Try navigating the entire page using only a keyboard </strong>- Tab, Shift + Tab, Enter, Escape. Can you reach and activate everything? If you can’t, neither can keyboard-dependent users.</li><li><strong>Run pages through free tools like WAVE or axe DevTools</strong>. They won’t catch everything, but they’re a fast way to surface common issues and are straightforward to use without a technical background.</li><li><strong>Go through any forms on the site </strong>- contact forms, search, newsletter sign-ups. Are labels clearly visible? Are required fields flagged upfront? Do error messages explain what went wrong, rather than just that something did?</li><li><strong>Walk through the main user journeys and watch for anything that interrupts or traps</strong>. Modals that won’t close, elements that vanish when focused, pop-ups that block the page - these are the kinds of things that make a site genuinely unusable for some people.</li></ul><p><strong>What to flag:</strong></p><ul><li>Interactive elements that can’t be reached or triggered with a keyboard.</li><li>Form errors that are vague or unhelpful - “something went wrong” with no further detail leaves users stuck.</li><li>Popups or overlays that don’t close properly, or that trap keyboard focus inside them.</li><li>Forms that don’t communicate errors or status changes to screen readers.</li><li>Keyboard traps in custom components - mega-menus, dropdowns, or modals you can’t exit without a mouse.</li></ul><h4><strong>Post-launch</strong></h4><p>Go-live isn’t the finish line for accessibility. Sites get updated, features get added, and content changes - often without the same level of scrutiny that went into the original build. It’s worth keeping accessibility on the agenda after launch, not just before it.</p><p><strong>What to do:</strong></p><ul><li><strong>Make sure accessibility is part of the conversation whenever updates or new features are being planned</strong>. Changes that seem minor can introduce new issues.</li><li><strong>Keep an eye on support tickets and analytics for signs of friction</strong> — repeated drop-offs or user complaints on specific pages can point to accessibility problems that weren’t caught earlier.</li><li><strong>Where possible, gather feedback from a range of users</strong>, including those with access needs. Internal testing has limits, and real users often surface things a team won’t.</li><li><strong>Flag accessibility as part of project reporting and case studies</strong>. It’s a mark of quality, and clients notice when a team has thought about it consistently.</li></ul><p><strong>What to flag:</strong></p><ul><li>Content or feature updates made directly by the client or a third party, with no accessibility review.</li><li>New components or third-party plugins added post-launch that haven’t been tested.</li></ul><h4>Conclusion</h4><p>You don’t need to be technical to have a real effect on accessibility. Asking the right questions at the right time, spotting things that look off, and keeping it on the agenda at each stage - that’s most of the work.</p><p>The projects that get accessibility right tend to be the ones where someone was paying attention throughout, not just at the end. That’s something a project manager is well placed to do.</p><p>This guide is deliberately a starting point. There’s a lot more to accessibility than what’s covered here - but the best way to learn is to start looking. Try the keyboard test on a site you’re currently working on. Run a page through WAVE. Look at a design and ask whether the contrast works. Small habits, applied consistently, add up.</p><p>If you want to go further, the resources and links below are worth bookmarking. None of them requires a technical background to get something useful from them.</p><h4>References &amp; Tools</h4><ul><li><a href="https://www.w3.org/WAI/WCAG22/quickref/">WCAG 2.2 Guidelines</a></li><li><a href="https://webaim.org/resources/contrastchecker/">WebAIM Contrast Checker</a></li><li><a href="https://wave.webaim.org/">WAVE Accessibility Tool</a></li><li><a href="https://www.deque.com/axe/devtools/">axe DevTools by Deque</a></li><li><a href="https://chromewebstore.google.com/detail/mpobacholfblmnpnfbiomjkecoojakah">Silktide Accessibility Checker</a></li><li><a href="https://www.nvaccess.org/download/">NVDA Screen Reader</a></li><li><a href="https://www.levelaccess.com/blog/navigating-international-accessibility-laws/">Article: Navigating International Accessibility Laws</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab74134ef0a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From curiosity to certified]]></title>
            <link>https://sturit.medium.com/from-curiosity-to-certified-9abf0608d6c6?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9abf0608d6c6</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 06:51:58 GMT</pubDate>
            <atom:updated>2026-04-17T06:51:58.049Z</atom:updated>
            <content:encoded><![CDATA[<p>What my CPACC study process actually looked like, and what I took from it.</p><figure><img alt="an uncluttered study set-up: a laptop, notepad and pen, water bottle, and mobile phone" src="https://cdn-images-1.medium.com/max/1024/0*xUZjZr08Y-EYHCZt" /><figcaption>Photo by <a href="https://unsplash.com/@dkomow?utm_source=medium&amp;utm_medium=referral">Daniil Komov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Accessibility has been part of how I think about digital delivery for a long time - but the <strong>IAAP CPACC </strong>certification had been sitting on my to-do list for years before I actually did something about it.</p><p>This is the story of how I got there.</p><h4><strong>Where it started</strong></h4><p>Back in 2013, I was working as a full-stack .NET developer on a suite of public sector websites. The client had brought in a third-party accessibility consultant, and working closely with them changed how I thought about the job.</p><p>Up until that point, accessibility had been something I knew mattered, but my approach was fairly surface-level in practice - <a href="https://wave.webaim.org/">running templates through WAVE</a>, fixing whatever it flagged, and moving on. That project changed that. Learning how real users experienced the things I was building, and how often the gaps were things I’d simply never considered - really stuck with me.</p><p>From that point on, I tried to take those lessons from project to project and build upon them. I started reading more widely - picking up books on accessibility and usability, following the conversations happening online. The more I read, the more I found myself thinking about the topic beyond just the technical implementation.</p><p>That spilled into how I worked day to day. I’d speak up a little more in design reviews - questioning whether something was actually feasible, and try to push back on client requirements that might create problems down the line. And I’d bring colleagues along where I could - explaining the reasoning, flagging issues, and nudging where I could.</p><p>In 2018, the <strong>Public Sector Bodies (Websites and Mobile Applications) Accessibility Regulations </strong>came into force, giving real legal weight to accessibility requirements for public sector digital services in the UK. I was already working with the <a href="https://www.w3.org/WAI/standards-guidelines/wcag/"><strong>Web Content Accessibility Guidelines </strong></a>(WCAG) in mind, but that year also brought WCAG 2.1, and between the two, it became a lot harder for anyone to treat accessibility as optional.</p><h4><strong>Why CPACC</strong></h4><p>The <strong>Certified Professional in Accessibility Core Competencies </strong>(CPACC) is a credential from the <strong>International Association of Accessibility Professionals</strong> (IAAP). It covers the broader, more conceptual side of accessibility - disability models, statistics, etiquette, universal design, standards, and law - rather than technical implementation.</p><p>That was the appeal for me. My technical knowledge had been building for years. What I wanted was a firmer grounding in the foundations underneath it - the thinking behind the practice.</p><p>I’d wanted to pursue it for a while, but between sorting funding and finding a proper window to study, it kept getting pushed back. Both came together in September 2025.</p><h4><strong>Studying</strong></h4><p>I started looking at how other people had approached the exam and what materials they’d used. The answer that kept coming up was <strong>Deque University</strong>. Their online CPACC preparation course covered everything: disability concepts and models, statistics, etiquette, universal design across physical and digital environments, usability, standards, law, and organisational governance. A lot of ground, but the course paces it well.</p><p>I studied through November to January using three things: the official CPACC <strong>Body of Knowledge</strong>, the Deque University materials, and <strong>Udemy </strong>test preparation - an exam simulator with six practice exams of fifty questions each.</p><p>One useful thing I did, and I’d pass this on to anyone preparing, was using AI to help with supplementary practice questions straight from the CPACC Body of Knowledge.</p><p>I loaded the document into <strong>Google Gemini </strong>and whenever I had a spare fifteen or twenty minutes (on the bus, in a café, when adverts came on TV), I’d ask for a ten to twenty question multiple-choice quiz on a specific CPACC topic. Gemini would automatically render it as a clickable multiple-choice interface, which made the whole thing feel a lot more like a proper quiz than just reading a list of questions.</p><figure><img alt="Google Gemini output for a quiz showing a single question and multiple choice answers underneath." src="https://cdn-images-1.medium.com/max/1024/1*bIoByzjkq2Q6QTjnQl41MA.jpeg" /><figcaption><strong>Google Gemini </strong>output when prompted for a quick quiz based on the <strong>CPACC Body of Knowledge</strong></figcaption></figure><p>I started to feel reasonably prepared, though the practice exams kept me honest about the gaps still left to fill.</p><p>When the January/February 2026 exam window opened, I booked a slot at a <strong>Pearson VUE </strong>test centre for early February. The nearest one that hosted the CPACC exam wasn’t exactly local, but the booking was straightforward enough.</p><p>At this time I moved into more structured revision - roughly an hour of reading each evening, then twenty to thirty minutes of practice questions. Three weeks out, I used AI again to build a run-up study plan, mapping each night to specific areas with targeted questions alongside it. Having that structure in the final stretch stopped me from drifting.</p><h4><strong>Exam day</strong></h4><p>The test centre was about two hours away, so it was an early start. I arrived with time to spare, went through check-in, and was shown to the exam room - a standard setup of workstations in blinkered cubicles.</p><p>The exam consists of one hundred multiple-choice questions across all the topic areas, and two hours to complete. There were plenty of close / distractor options designed to catch you out - so I was able to flag anything I wasn’t confident on and came back to those…quite a few times.</p><p>I walked out thinking I’d completely blown it. Two hours in the car home, turning the questions over in my head, convinced I’d got so many wrong. When I got back, I had to stop myself opening the Body of Knowledge again - as I knew I’d just be torturing myself.</p><p>Since getting my result, I have gone back over the material, particularly the areas that tripped me up. <strong>Universal Design for Learning </strong>was one: I needed to understand the three guidelines well enough to explain them and give examples, not just recognise them. <strong>Organisational Planning and Implementation </strong>was another - and probably the more useful area in terms of actually applying any of this at work.</p><h4><strong>The wait</strong></h4><p>IAAP advises that results take four to six weeks.</p><p>Mine came through on 1st April 2026. <strong>April Fool’s Day</strong>. My first thought when I saw the date was that someone was having a laugh. They weren’t - I’d actually passed!</p><p>Along with the result came an invitation to a <strong>Certification Orientation</strong> webinar covering how to maintain the credential. CPACC requires documented continuing education credits every three years, and the webinar walked through how to record and submit those. There was a helpful Q&amp;A session at the end too.</p><h4><strong>What I took from it</strong></h4><p>This isn’t a certification about markup, code, or technical knowledge. It’s about understanding disability, understanding people, understanding why accessible design matters beyond just hitting a compliance requirement. My technical knowledge didn’t change - but having the concepts underneath it does feel different.</p><p>IAAP have built something worth paying attention to. The CPACC is one credential in a broader framework designed to professionalise accessibility as a discipline - and that matters. Having a recognised body that sets standards for what people should know, regardless of their role or specialism, raises the bar for the whole field.</p><p>If you work in digital and have any interest in accessibility, the certification is worth looking at seriously - whether you’re a developer, designer, project manager, or something else entirely. The Deque University course is a solid starting point, the Body of Knowledge is a thorough guide, and using AI for self-testing makes the revision process more manageable.</p><p>I’m planning to pursue the <a href="https://www.accessibilityassociation.org/was-exam"><strong>Web Accessibility Specialist </strong></a>(WAS) certification next - as I want structured learning on the technical side to sit with the conceptual understanding I now have. And honestly, beyond any certification, this is just an area I want to keep going deeper on.</p><p>If you’ve recently sat the CPACC, or you’re planning to, I’d be interested to hear how you found it.</p><ul><li><a href="https://www.accessibilityassociation.org/cpacc">IAAP Certified Professional in Accessibility Core Competencies</a></li><li><a href="https://dequeuniversity.com/online-courses/iaap-cpacc">Deque University: IAAP CPACC Exam Preparation</a></li><li><a href="https://www.udemy.com/course/cpacc-exam-mastery-interactive-simulator/">Udemy: CPACC Exam Mastery Comprehensive Practice Tests</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9abf0608d6c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop reaching for the CSS clamp calculator]]></title>
            <link>https://sturit.medium.com/stop-reaching-for-the-clamp-calculator-6197a7bf69a9?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6197a7bf69a9</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 16:22:17 GMT</pubDate>
            <atom:updated>2026-04-13T20:28:59.373Z</atom:updated>
            <content:encoded><![CDATA[<h4>A small function that keeps you in your IDE</h4><figure><img alt="A blue clamp tool" src="https://cdn-images-1.medium.com/max/1024/0*gkgmoFFAZGviR6is" /><figcaption>Photo by <a href="https://unsplash.com/@glencarrie?utm_source=medium&amp;utm_medium=referral">Glen Carrie</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In web development, consistent and adaptive layouts often mean rolling up your sleeves for some specific calculations. For a while, I was handling those by jumping between VS Code and third-party tools every time I needed a value for CSS properties like clamp(). It was disruptive, and eventually, it became something I wanted to fix. I put this together back in 2023, and it’s been part of my workflow ever since.</p><h4>Understanding clamp()</h4><p>clamp() in CSS is a function that sets a value which adjusts responsively within a defined range. It takes three parameters: a minimum value, a preferred value (in my case, always tied to viewport width), and a maximum value. The result is that properties like font-size can scale fluidly between set limits - with no media queries needed.</p><p>Here’s a basic example:</p><pre>.clamp-example {<br>  font-size: clamp(1rem, 2.5vw, 2rem);<br>}</pre><h4>SCSS clamper</h4><p>To get out of the habit of reaching for external tools, I looked into how those calculators handle their maths and built a small SCSS function called clamper. It takes care of the preferred value calculation, so I can stay in my editor and keep moving.</p><p><strong>Here’s the function:</strong></p><pre>@use &#39;sass:math&#39;;<br><br>@function clamper($min-size, $max-size, $min-vw: 20rem, $max-vw: 80rem) {<br>  $slopeVal: math.div(($max-size - $min-size), ($max-vw - $min-vw));<br>  $interVal: $min-size - ($slopeVal * $min-vw);<br>  @return clamp(#{$min-size}, #{$interVal} + #{($slopeVal * 100vw)}, #{$max-size});<br>}</pre><h4><strong>Breaking it down</strong></h4><p>The function accepts four parameters<strong>:</strong></p><ul><li>$min-size - the minimum size of the element (a font size, padding value, or similar)</li><li>$max-size - the maximum size of the element</li><li>$min-vw - the viewport width at which the element reaches its minimum size; I set this to a small viewport, typically mobile (default: 20rem)</li><li>$max-vw - the viewport width at which the element reaches its maximum size; this usually matches the max content width on larger viewports (default: 80rem)</li></ul><p>Two values are then calculated internally<strong>:</strong></p><ul><li>$slopeVal stores how quickly the size shifts between its two limits as the viewport width changes</li><li>$interVal stores the starting point of the size, based on the minimum size and slope value</li></ul><p>From those, the function returns a complete clamp() expression, ensuring the size scales fluidly between the two limits as the viewport width changes.</p><h4>Usage in SCSS</h4><pre>.my-clamped-text {<br>  font-size: clamper(1.25rem, 2rem); /* no min-vw or max-vw passed - the defaults work fine here */<br>}</pre><p>When compiled, this produces:</p><pre>.my-clamped-text {<br>  font-size: clamp(1.25rem, 1rem + 1.25vw, 2rem);<br>}</pre><h4>How it helps me</h4><p>Dropping clamper into my SCSS workflow has made a real difference:</p><ul><li><strong>Efficiency: </strong>No more switching between VS Code and a browser tab. I was forever flipping back and forth, largely because I cannot work out the preferred value in my head.</li><li><strong>Consistency: </strong>Responsive sizing stays uniform across a project, reducing the risk of small miscalculations creeping in over time.</li><li><strong>Maintainability: </strong>The logic lives in one place. If something needs to change, I know exactly where to look.</li></ul><h4><strong>Wrapping up</strong></h4><p>It’s a small function, but it removed something that was quietly costing me time. No more guessing the preferred values, and no more breaking my flow to open a calculator.</p><h4>Further reading &amp; resources</h4><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/clamp/">Understanding clamp() via MDN Web Docs</a></li><li><a href="https://web.dev/articles/min-max-clamp">How to control element sizing via Google Web.Dev</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6197a7bf69a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’ve been fighting this CMS padding issue for years. Modern CSS just won.]]></title>
            <link>https://sturit.medium.com/cms-layouts-say-goodbye-to-padding-problems-aa28ff3184f0?source=rss-0e23c031df1c------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa28ff3184f0</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Stuart]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 07:24:48 GMT</pubDate>
            <atom:updated>2026-04-03T12:08:32.073Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>How :has() and :not() automatically fix double-padding in CMS layouts with no JavaScript required.</em></h4><figure><img alt="abstract architectural padding" src="https://cdn-images-1.medium.com/max/1024/0*VhYwsmVbVYNw0922" /><figcaption>Photo by <a href="https://unsplash.com/@zhpix?utm_source=medium&amp;utm_medium=referral">Pascal Meier</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>JavaScript hacks. Giving editors padding controls. Hoping for the best. I’ve tried most approaches to the same stubborn problem, and none of them felt right. They were either too fragile, too fiddly, or quietly made things worse.</p><p>The issue is straightforward enough: content editors have the freedom to arrange sections however they like, and that freedom comes at a cost. Get two sections of the same background colour sitting next to each other and the padding doubles up. The design you spent weeks getting right suddenly looks broken.</p><p>Then <strong>:has()</strong> and :<strong>not()</strong> came along and made the whole thing almost embarrassingly simple.</p><h4>The problem</h4><p>The setup is common: a front-end build is crafted separately, then broken down into blocks or components inside the CMS. Editors can use those blocks to build pages however they like. In theory, that’s exactly what you want. In practice, it gets messy.</p><p>Each section carries its own top and bottom padding, along with colour modifiers. Take a basic .section-wrapper with padding-block: 6rem;, and colour variants like .section-wrapper--white, .section-wrapper--blue, and .section-wrapper--yellow.</p><p>When an editor places two sections of the same colour next to each other, the padding doubles up. Instead of a seamless transition, you get an awkward, oversized gap. The visual balance is gone.</p><p>In the image below, you can see exactly that: doubled padding between the two blue sections and between the two white sections.</p><figure><img alt="Sections with inconsistent blocks and different padding. The unbalanced padding looks doubled" src="https://cdn-images-1.medium.com/max/1024/0*QkzqoqjqV6bNa4XG.jpg" /></figure><h4>Previous workarounds</h4><p>Over the years I’ve tried a few approaches. JavaScript to adjust the padding dynamically worked, but it felt clunky and fragile. Giving editors control over the padding themselves seemed sensible at first, but quickly led to inconsistent layouts - particularly on sites with multiple editors and varying levels of attention to detail.</p><p>What I wanted was something automatic. When two or more sections of the same colour sit next to each other, the padding should reduce itself. No editor input required, no JavaScript, no overrides. Modern CSS, specifically <strong>:has()</strong> and <strong>:not()</strong> - makes that possible.</p><h4>A solution</h4><p>Using SCSS, I was able to put together a mixin that adjusts padding based on adjacent sections.</p><p>Let’s have a look at the SCSS:</p><pre>@use &#39;sass:math&#39;;<br><br>$base-padding: 6rem;<br>$half-padding: math.div($base-padding, 2);<br><br>.section-wrapper {<br>  padding-block: $base-padding;<br>  /* other shared styles */<br>}<br><br>@mixin wrapper-styles($colour-name, $bg-colour) {<br>  .section-wrapper--#{$colour-name} {<br>    background-color: $bg-colour;<br><br>    /* adjacent element of the same type */<br>    &amp;:has(+ .section-wrapper--#{$colour-name}) {<br>      padding-block-end: $half-padding;<br>    }<br><br>    /* the element is directly following another of the same type */<br>    &amp; + .section-wrapper--#{$colour-name} {<br>      padding-block: $half-padding;<br>    }<br><br>    /* reset if the next element is different or last */<br>    &amp;:has(+ :not(.section-wrapper--#{$colour-name})),<br>    &amp;:last-of-type {<br>      padding-block-end: $base-padding;<br>    }<br>  }<br>}<br><br>/* use the mixin to set up our different colours */<br>@include wrapper-styles(&#39;white&#39;, #fff);<br>@include wrapper-styles(&#39;blue&#39;, #cff4f5);<br>@include wrapper-styles(&#39;yellow&#39;, #fef8ca);</pre><h4>How it works</h4><p>We start by importing the math module from SCSS. It’s not strictly necessary for the logic, but it makes the code easier to maintain - anyone can then update a single value and have it cascade through automatically.</p><p>$base-padding is set to 6rem, the default padding for all our sections in this demo. From that, we calculate $half-padding as 3rem, which is applied when two sections of the same type sit next to each other.</p><pre>@use &#39;sass:math&#39;;<br><br>$base-padding: 6rem;<br>$half-padding: math.div($base-padding, 2);</pre><p>We set the default block padding for all sections. In this example each section will have 6rem padding on the top and bottom.</p><pre>.section-wrapper {<br>  padding-block: $base-padding;<br>}</pre><p>The wrapper-styles mixin takes two parameters: $colour-name and$bg-colour.</p><pre>@mixin wrapper-styles($colour-name, $bg-colour) {<br>  .section-wrapper--#{$colour-name} {<br>    background-color: $bg-colour;<br><br>    /* adjacent element of the same type */<br>    &amp;:has(+ .section-wrapper--#{$colour-name}) {<br>      padding-block-end: $half-padding;<br>    }<br><br>    /* the element is directly following another of the same type */<br>    &amp; + .section-wrapper--#{$colour-name} {<br>      padding-block: $half-padding;<br>    }<br><br>    /* reset if the next element is different or last */<br>    &amp;:has(+ :not(.section-wrapper--#{$colour-name})),<br>    &amp;:last-of-type {<br>      padding-block-end: $base-padding;<br>    }<br>  }<br>}</pre><h4>:has()</h4><p>The <strong>:has() </strong>pseudo-class lets you apply styles to an element based on what follows or contains it. Here, it checks whether the current .section-wrapper--#{$colour-name} has an immediately adjacent sibling of the same type. If it does, the bottom padding drops to $half-padding, preventing the doubling effect.</p><pre>&amp;:has(+ .section-wrapper--#{$colour-name}) {<br>  padding-block-end: $half-padding;<br>}</pre><h4>Adjacent sibling selector</h4><p>This handles the outgoing section, but the incoming one needs attention too. The adjacent sibling rule targets any .section-wrapper--#{$colour-name} that directly follows another of the same type, and reduces its padding-block to $half-padding - trimming both the top and bottom padding on that second section.</p><p>Between the two rules, the overlap is cleanly halved on both sides. Neither section is doing all the work.</p><pre>&amp; + .section-wrapper--#{$colour-name} {<br>  padding-block: $half-padding;<br>}</pre><h4>:not()</h4><p>The <strong>:not() </strong>pseudo-class excludes elements matching a given selector. When the next section is a different colour, <strong>:not()</strong> resets the bottom padding to $base-padding, keeping the spacing consistent across section transitions. It also accounts for the last section of a given type.</p><pre>&amp;:has(+ :not(.section-wrapper--#{$colour-name})),<br>&amp;:last-of-type {<br>  padding-block-end: $base-padding;<br>}</pre><p>Between the three, every scenario is covered:<strong> :has() </strong>handles the tail of the first section, the adjacent sibling selector handles the head of the second, and<strong> :not() </strong>cleans up at the boundaries.</p><h4><strong>Finally, using the mixin</strong></h4><p>The wrapper-styles mixin generates classes for each background colour: white, blue, and yellow. It&#39;s fully reusable and easy to extend - add as many colours or variants as the project requires.</p><pre>@include wrapper-styles(&#39;white&#39;, #fff);<br>@include wrapper-styles(&#39;blue&#39;, #cff4f5);<br>@include wrapper-styles(&#39;yellow&#39;, #fef8ca);</pre><p>Here’s an image of an example with more balanced padding:</p><figure><img alt="A demo of the sections with more balanced padding." src="https://cdn-images-1.medium.com/max/1024/0*C7Qi6WcCCMYPF751.jpg" /></figure><h4>Conclusion</h4><p>The goal was simple: keep the layout polished and balanced regardless of how editors arrange the sections, without putting the burden on them to manage spacing manually. <strong>:has()</strong> and<strong> :not()</strong> deliver that in a way that feels robust rather than bolted on.</p><p><a href="https://codepen.io/sturit/pen/NWQVdjZ">Try out the full Layout Padding Demo on Codepen</a></p><p><strong>Note</strong>: I haven’t used the sass:math approach on Codepen - it wouldn’t play ball!</p><p>If you’re dealing with something similar, take a look at the demo and see if it fits your situation. It’s flexible, low-maintenance, and has saved me a lot of time on CMS-heavy projects. If you have a different approach, I’d genuinely like to hear it - get in touch.</p><p>Happy padding!</p><h3>Further reading &amp; resources</h3><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:has">:has() information at MDN</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:not">:not() information at MDN</a></li><li><a href="https://sass-lang.com/">SCSS/ SASS website</a></li><li><a href="https://sass-lang.com/guide/#mixins">SCSS/ SASS Mixins guide</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa28ff3184f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>