<contenttype="html"><p>Recently, I <a href="https://flipping.rocks/@inherentlee/117037989967706516" target="_blank" rel="external">asked on the Fediverse</a> about visual/drag-and-drop website builders and got a wealth of answers.</p>
<p>I want to evaluate based on some accessibility factors:</p>
<ol>
<li><strong>Semantic HTML:</strong> how well does the builder adhere to properly formed semantic HTML?</li>
<li><strong>Keyboard navigation:</strong> is keyboard focus visible? Can it be customized? (I was going to review skip links, but I'm a half dozen sites in and none have supported them thus far, at least not without entirely custom code)</li>
<li><strong>Reading order:</strong> is reading order automatically correct? If not, what does the user have to do to ensure correctness?</li>
<li><strong>Text alternatives:</strong> is there support for alt text?</li>
<li><strong>Color:</strong> does the builder support light and dark modes? (Note that I am looking for builders for those with no HTML/CSS experience, and &quot;you can customize with CSS&quot; is not acceptable)</li>
<li><strong>Other accessibility concerns:</strong> anything else of note?</li>
</ol>
<p>I will score <strong>1</strong> (bad), <strong>2</strong> (mixed), or <strong>3</strong> (good). If there is nothing to note for the &quot;other&quot; factor, I will score it as a 2. These scores <strong>will not be weighted</strong> according to priorities, but purely summed for a final ranking.</p>
<p>There are, of course, many more factors that could be evaluated, but I will be focusing on these high-level ones.</p>
<p>Want to just see the final ranking? Pop down to the <a href="https://leecat.art/visual-site-builders-and-accessibility/#summary">summary</a>.</p>
<h2 id="blocs">Blocs</h2>
<p><a href="https://blocsapp.com/" target="_blank" rel="external">Blocs</a> is a builder for MacOS, iPad, and iPhone. I had trouble getting a template loaded on my iPad, but I reviewed the Blocs website - built with Blocs, of course - for major issues. This is, I would assume, the shiniest version possible.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>Most major elements missing (no <code>&lt;main&gt;</code>, <code>&lt;header&gt;</code>, <code>&lt;footer&gt;</code>; <code>&lt;nav&gt;</code> present for the top nav but not bottom).</td>
<td>1</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>Custom focus, missing in many areas on the Blocs site and turned off by default in the CSS - not sure if that is for this site or is the standard. The ability to potentially customize focus is interesting.</td>
<td>1</td>
</tr>
<tr>
<td>Reading order</td>
<td>Good! Block-based layout helps significantly here I would guess.</td>
<td>3</td>
</tr>
<tr>
<td>Text alternatives</td>
<td>Supported.</td>
<td>3</td>
</tr>
<tr>
<td>Color</td>
<td>Light and dark modes are possible - <a href="https://help.blocsapp.com/knowledge-base/dark-theme/" target="_blank" rel="external">Blocs dark mode documentation</a>.</td>
<p><a href="https://cowsites.net" target="_blank" rel="external">Cowsites</a> is a simple site editor with no drag-and-drop elements.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>Some oddities, like the <code>&lt;header&gt;</code> being inside the <code>&lt;main&gt;</code> while the <code>&lt;footer&gt;</code> was not. Repeated <code>&lt;h1&gt;</code>s.</td>
<td>2</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>Browser default focus outlines. Some clipping of focus outlines.</td>
<td>2</td>
</tr>
<tr>
<td>Reading order</td>
<td>Good. Difficult to mess up when there are no drag-and-drop elements.</td>
<td>3</td>
</tr>
<tr>
<td>Text alternatives</td>
<td>Both image title and alt can be set in the editor, but don't appear to be surfaced in the actual site.</td>
<td>1</td>
</tr>
<tr>
<td>Color</td>
<td>Single color palette.</td>
<td>1</td>
</tr>
<tr>
<td>Other</td>
<td>No <code>lang</code> attribute set. Gallery page links are three separate links to the same place, with lacking link text for links 2 and 3.</td>
<p><a href="https://www.figma.com/sites/" target="_blank" rel="external">Figma Sites</a> allows you to turn a Figma design into a functioning website. It offers gen AI features. I tested two themes from Figma Community.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>Depends <em>heavily</em> on developer. One was <code>&lt;div&gt;</code>s all the way down, one was built with actual semantic HTML using the &quot;Accessibility&quot; section of one of the sidebars (it allows you to specify the tag a design element corresponds to). Notably, not a lot or a total lack of links? One theme had some <code>&lt;buttons&gt;</code>s, the other was littered with click events and <code>tabindex=&quot;0&quot;</code>.</td>
<td>1</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>Browser default focus outlines. One template <em>actually</em> had a skip link!</td>
<td>2</td>
</tr>
<tr>
<td>Reading order</td>
<td>Not clear how order is determined. Potentially partially influenced by order of elements in the sidebar, but one theme tested did not adhere to that and the nav was the last in the reading order despite being top of the sidebar order. I can't publish on the starter plan, so I can't see how my own changes influence the site, but with a well-built theme the organization helps ensure that adding new elements puts them in a reasonable place in the sidebar order.</td>
<td>2</td>
</tr>
<tr>
<td>Text alternatives</td>
<td>Supported.</td>
<td>3</td>
</tr>
<tr>
<td>Color</td>
<td>Light and dark modes are possible - <a href="https://help.figma.com/hc/en-us/articles/15343816063383-Modes-for-variables" target="_blank" rel="external">Figma variable modes documentation</a>.</td>
<p><a href="https://tomotama.com/kiki" target="_blank" rel="external">Kiki</a> is a simple site builder with no drag-and-drop elements. You can customize the CSS to your liking. I played with the demo site.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>It's <code>&lt;div&gt;</code>s all the way down. No headers. <code>&lt;p&gt;</code> tags used, at least.</td>
<td>1</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>Browser default focus outlines. Significant focus outline clipping. Should be fixable with CSS... if we wanted to write CSS.</td>
<td>2</td>
</tr>
<tr>
<td>Reading order</td>
<td>Good. Difficult to mess up when there are no drag-and-drop elements.</td>
<td>3</td>
</tr>
<tr>
<td>Text alternatives</td>
<td>Seemingly not present, though there are no images in the demo site.</td>
<td>1</td>
</tr>
<tr>
<td>Color</td>
<td>Since you can write your own CSS, all color is customizable... if we wanted to write CSS.</td>
<td>1</td>
</tr>
<tr>
<td>Other</td>
<td>No <code>lang</code> attribute set. No <code>title</code>.</td>
<p><a href="https://mmm.page/" target="_blank" rel="external">mmm.page</a> is a drag-and-drop builder. The preview doesn't show you a standalone page (it's a page that also has the mmm.page login/signup menu bar), so I looked at a few sites to get a sense for how it worked.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>While there is a <code>&lt;main&gt;</code>, it's otherwise <code>&lt;div&gt;</code>s all the way down. Generally no headers, though sites seem to have a visually hidden <code>&lt;h1&gt;</code> that matches the site title. <code>&lt;p&gt;</code> tags used, at least.</td>
<p><a href="https://www.realmacsoftware.com/rapidweaver/" target="_blank" rel="external">Rapidweaver</a> is built exclusively for Mac. Ah, well.</p>
<h2 id="showit">Showit</h2>
<p><a href="https://showit.com/" target="_blank" rel="external">Showit</a> is a drag-and-drop builder with a Wordpress backend for content management. I reviewed several different premade themes. Custom CSS is allowed.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>Depending on theme, <em>some</em> landmark tags might be present. One theme reviewed enclosed each individual nav link in a <code>&lt;nav&gt;</code> tag. Ew. Text can be set to be wrapped in a variety of tags, including bare <code>&lt;div&gt;</code>s.</td>
<td>1</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>The default CSS reset for Showit removes focus outlines on some elements (form fields and buttons, but not links). In one tested theme, further focus outlines were missing. Browser default focus outlines. Despite detailed ability to customize hover states in-editor, no ability to customize focus states.</td>
<td>1</td>
</tr>
<tr>
<td>Reading order</td>
<td>Determined by the user via reordering elements in the sidebar.</td>
<p><a href="https://designmodo.com/startup/" target="_blank" rel="external">Startup</a> is a block-based builder with pre-defined components and less freedom than some others on this list.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>Pretty good! They've seemingly dropped <code>&lt;main&gt;</code> and instead used an array of <code>&lt;section&gt;</code>s, but components are automatically associated with <code>&lt;header&gt;</code>, <code>&lt;nav&gt;</code>, <code>&lt;footer&gt;</code>, etc.</td>
<td>Very orderly thanks to the strictness of the components - it's one component after another. Moving pieces around within the components maintains correct reading order.</td>
<td>3</td>
</tr>
<tr>
<td>Text alternatives</td>
<td>Supported.</td>
<td>3</td>
</tr>
<tr>
<td>Color</td>
<td>Per-component color palette.</td>
<td>1</td>
</tr>
<tr>
<td>Other</td>
<td>Forms are weak - unlabeled fields and buttons. For a built in search field, I'd expect better. The components by default are <em>super</em> animation-heavy and don't respect <code>prefers-reduced-motion</code>.</td>
<p><a href="https://straw.page/" target="_blank" rel="external">Straw.Page</a> is a drag-and-drop builder that bills itself as mobile-friendly. I looked at one of the offered themes, intentionally choosing one that should have intuitive reading order (spoiler: didn't matter).</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>It's <code>&lt;div&gt;</code>s all the way down. No headers. <code>&lt;p&gt;</code> tags used, at least. Lists are just <code>&lt;p&gt;</code>s.</td>
<td>1</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>Focus actively turned off.</td>
<td>1</td>
</tr>
<tr>
<td>Reading order</td>
<td>Order of elements added determines reading order.</td>
<p><a href="https://univer.se/" target="_blank" rel="external">Univer.se</a> is a drag-and-drop builder with plenty of premade themes. I reviewed a premade theme to get started.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>It's <code>&lt;div&gt;</code>s all the way down. Headers exist, but there are multiple <code>&lt;h1&gt;</code>s and the headers skip levels. <code>&lt;p&gt;</code> tags used, at least.</td>
<td>Surprisingly intuitive! Univer.se uses a grid-based layout system and that seems to help programmatically determine reading order.</td>
<p><a href="https://webflow.com/" target="_blank" rel="external">Webflow</a> is a drag-and-drop builder. Currently bottom of my review list due to AI features.</p>
<p><a href="https://https://www.webnode.com">Webnode</a> is a drag-and-drop builder (with gen AI features). I reviewed a site built in it sent by the recommender as well as one of the premade themes.</p>
<p><a href="https://wwwobble.org/">Wobble Web</a> is a drag-and-drop editor that allows you to edit the code directly in browser as well. There's no preview site; you can download the code and view it locally or publish it yourself. While there's a lot of flexibility for text styling, it's all tied directly to CSS rules, so you need to know some CSS to be effective.</p>
<table>
<thead>
<tr>
<th>Factor</th>
<th>Notes</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Semantic HTML</td>
<td>It's <code>&lt;div&gt;</code>s all the way down. No headers. <code>&lt;p&gt;</code> tags used, at least.</td>
<td>1</td>
</tr>
<tr>
<td>Keyboard navigation</td>
<td>Browser default focus outlines. Should be editable with CSS... if we wanted to write CSS.</td>
<td>2</td>
</tr>
<tr>
<td>Reading order</td>
<td>Order of elements added determines reading order.</td>
<contenttype="html"><p>What CSS would you implement if you had no or very low vision? Recently, a Blind friend wanted to know more about CSS. This is my attempt at a very minimal CSS file that cleans up a few <a href="https://browserdefaultstyles.com/" target="_blank" rel="external">browser defaults</a> for a more pleasant browsing experience without needing much if any visual testing.</p>
<p>Want to just see the final stylesheet? <a href="https://leecat.art/core-css/#result">Skip to the end of the page</a>.</p>
<p>Before we start: this isn't a CSS reset. You may want to apply it in concert with one. While writing this, a friend recommended <a href="https://www.joshwcomeau.com/css/custom-css-reset/" target="_blank" rel="external">Josh W. Comeau's CSS Reset</a>, which looks largely very solid to me. However, if using that particular reset, I would <em><strong>not</strong></em> reset default margins (rule 2). They are tremendously useful in this case, where we are unlikely to be setting margins on elements individually.</p>
<h2 id="color">color</h2>
<p>Complex color palettes are a no-go. But browser defaults are also pretty bad - stark black and white are really hard on sighted users' eyes. Dulling the black and white down to nearby grays helps a lot. And of course, we'll support light and dark modes.</p>
<p>To skip reading about accent colors, head right to <a href="https://leecat.art/core-css/#focus-indication">focus indication</a>.</p>
<p>If you have any opinions about color, you might pick accents. At the simplest level, I'd pick one for light mode and one for dark mode. <a href="https://xkcd.com/color/rgb/" target="_blank" rel="external">XKCD has a color sheet based on a wide survey</a> that is potentially useful here. Validate that the color contrast is enough with a tool like <a href="https://webaim.org/resources/contrastchecker/" target="_blank" rel="external">WebAIM's Contrast Checker</a>. You might color your headers and links.</p>
<p>If you're coloring links, it's worth considering browser defaults. Blue is unvisited, purple is visited, and red is inactive. Choosing a red or purple link color might confuse users. Blues are pretty safe. A green might be fun.</p>
<p>Being the person that I am, I'm picking a teal and a pink. XKCD labels these &quot;dark teal&quot; (contrast ratio of 7.11 against our gray-white) and &quot;powder pink&quot; (contrast ratio of 9.49 against our gray-black) respectively.</p>
<p>Focus indication is a visual change that occurs when something interactive on the screen (like a link) receives keyboard focus. Without it, sighted keyboard-only users can't tell where they are on the page. Conventionally, it's an outline. <a href="https://www.sarasoueidan.com/blog/focus-indicators/" target="_blank" rel="external">Read more about accessible focus indication</a>.</p>
<p>I would recommend a <em>smidge</em> of padding (spacing <em>inside</em> the border or outline of an element) around your links to allow for more space between the letters and focus outline in order to help with legibility.</p>
<p>If you recolor your links as mentioned in the previous section, recolor your focus indication for cohesiveness! Additionally, if you overwrite the browser default focus outline in this way or any other, you might want to add a very small border radius to your links. I find that perfectly square corners are a bit of a harsh look, but I'll admit this one is kind of personal preference.</p>
<p>All-serif everything (a common browser default) is, uh, kinda ugly and overwhelming. Little tails on every letter are visual clutter, at least to my eyes. It feels outdated, like an old-timey newspaper. Picking serif for headers and sans-serif for body (or vice versa) can be a nice alternative. Plus, the contrast will help on lower-level headings... if you ever drill down to <code>h5</code>s or <code>h6</code>s anyway.</p>
<p>Margins create visual space around an element, and this whitespace helps significantly with focus. We're <em>super super not</em> going to reset the margins for everything. That puts us in design hell and becomes a very visually-oriented problem. Instead, we're just changing two things: the width of the body and where it sits on the page. Readers, particularly dyslexic readers, can more easily move to the next line when they are not trying to track back across the full width of the screen.</p>
<p>This margin rule defines a small amount of top/bottom space first (<code>1rem</code>), and then tells the page to make the left and right margins equal with <code>auto</code> - centering the body in the middle of the page. I'm also going to set a <code>max-width</code> to handle those mystical ultra-wide screens (never used one), and a couple of breakpoints for tablets and mobile.</p>
<p>One quick note about accessible links: they should be identifiable by a method other than color. Basically, don't turn off your underlines! Additionally, I would recommend against using underlines for emphasis elsewhere - use <code>&lt;em&gt;</code> or <code>&lt;strong&gt;</code> instead.</p>
<h2 id="images">images</h2>
<p>As mentioned up top, this overlaps with the linked CSS Reset writeup.</p>
<p>By default, an image will be full size. If it's a large image, that can be even larger than the viewport. We'll give them a <code>max-width</code> and center them in case they are narrower than the body. <code>display: block</code> allows that centering to actually work.</p>
<p>Let's talk the components that every page likely has - a header, a footer, and navs. I'm going to use a very simple design for our header - a <a href="https://webaim.org/techniques/skipnav/" target="_blank" rel="external">skip link</a>, an (optional) site title (the title could also be one of the nav links), and then an unordered list of links enclosed in a <code>nav</code> element. Like the following:</p>
<p>Let's handle the skip link first. Your skip link can be hard to style without visual feedback. Commonly, they start hidden and only appear when receiving keyboard focus. It's entirely reasonable, in my opinion, to leave it visible. <strong>I actually like this as a design choice</strong>, as it highlights the idea and hopefully purpose of a skip link to sighted readers. However, if you want to hide it, there's a lot (a <em>lot</em>) of ways to do so. Using <code>position: absolute</code>, <code>left</code>, and <code>top</code>, we can place the skip link outside of the page, then move it in when it receives focus. We'll also stick a background on there to prevent the text from overlaying our site title and becoming illegible.</p>
<p>I won't do much here, but I am going to remove the underline (which is the default for links). It's commonly understood that the site title (or sometimes just the word &quot;home&quot;) links to the home page, and the underline is unnecessary visual clutter.</p>
<p>We're going to dip our toes into flexbox for this one - it allows us to make content fall neatly into rows or columns. It's pretty powerful, and can get pretty weird, but we'll keep it bare-bones.</p>
<p>By default, the unordered lists in the navs will display with each list item on a new line with a bullet point in front of the list item. Let's take up less space by putting them all on one line. I'm going to center the items, and I'm going to allow them to wrap onto a new line. I'm also taking the bullet points off of the list items and allowing for a bit of space between each item.</p>
<p>Screen reader users get <code>aria-current</code> information, and it can be helpful to present it to sighted users as well. There are of course many ways to do this with color, but we'll avoid that. Let's add carets before and after the current page link to indicate this. We'll scope them only to the header and footer just in case we run across a weird case.</p>
<p>The content after the forward slash is what is conveyed to screen reader users. The carets are not useful from a screen reader perspective, so this excerpts them.</p>
<h3 id="separating-header-and-footer-from-main">separating header and footer from main</h3>
<p>The header and footer can visually run into the main text area if there's not extra space or a border. We'll keep it simple with borders. If you're not using an accent color, use your text color instead.</p>
<p>There's a couple straightforward additions we can make to handle printing the site cleanly and making best use of the physical paper space. Remove the header and footer, reset the width and colors to limit ink usage, and print link URLs after the link.</p>
<contenttype="html"><p>My new project <a href="https://fedilearns.fyi" target="_blank" rel="external">FediLearns</a> is a learning-focused classifieds page for the fediverse. Check it out!</p>
<contenttype="html"><p>Recently I've been working on a single-page digital rendition of a zine complete with many hand-drawn images. The author wanted to be able to bring images up to a full-screen view, to either zoom in or to put the whole enlarged image on one screen with no scrolling. It was a real struggle to find resources on how to do this in an accessible manner, so I'm writing up what I did.</p>
<blockquote>
<p>Fair warning: This solution is likely imperfect.</p>
<p>do you know how many tutorials want you to roll your own modals? It's a not-insignificant amount. W3Schools, top of the search results in many cases, recommends it in two places - <a href="https://www.w3schools.com/howto/howto_css_modal_images.asp" target="_blank" rel="external">image modals</a> and <a href="https://www.w3schools.com/css/css3_images_modal.asp" target="_blank" rel="external">responsive image modals</a>. Several search results for &quot;image modal&quot; pop up div solutions - <a href="https://stackoverflow.com/questions/75598914/how-to-display-an-image-clicking-on-it-using-modal-window-on-html-css-and-js" target="_blank" rel="external">div modal 1</a>, <a href="https://dev.to/salehmubashar/create-an-image-modal-with-javascript-2lf3" target="_blank" rel="external">div modal 2</a>, <a href="https://www.youtube.com/watch?v=Y9TNHynFjaQ" target="_blank" rel="external">div modal 3</a>.</p>
<p>If you don't know of the existence of <code>&lt;dialog&gt;</code>, a search for image modals will not get you there quickly.</p>
<p>If you search for <em>accessible</em> image modals, you'll still hear about <code>&lt;div&gt;</code>s. Hell, <a href="https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/dialog/" target="_blank" rel="external">W3C's ARIA Authoring Practices Guide uses a <code>&lt;div&gt;</code></a>. You kinda have to go digging to read about the <a href="https://www.scottohara.me/blog/2023/01/26/use-the-dialog-element.html" target="_blank" rel="external">dialog element from Scott O'Hara</a> or find <a href="https://accessibleweb.dev/modals" target="_blank" rel="external">AccessibleWeb.dev's piece on modals</a>. Or you can go <a href="https://adrianroselli.com/2025/06/where-to-put-focus-when-opening-a-modal-dialog.html" target="_blank" rel="external">straight for Adrian Roselli</a> and find examples that use the native <code>&lt;dialog&gt;</code> element. Thanks Adrian!</p>
<p>Did I roll my own modal at first? Regretfully, yes. I'd used the <code>&lt;dialog&gt;</code> element before... several years ago... in a project I don't have access to anymore... Needless to say, I had forgotten about its existence.</p>
<p>Anyway, I got there. Eventually. So let's talk about modals and <code>&lt;dialog&gt;</code>.</p>
<h3 id="what-does-dialog-give-us">what does <code>&lt;dialog&gt;</code> give us?</h3>
<p>so, what do we get from the <code>&lt;dialog&gt;</code> element that we don't get from a <code>&lt;div&gt;</code> modal?</p>
<li>a backdrop that fills the screen behind the modal, styleable with <code>::backdrop</code></li>
<li>automatic use of the <code>Esc</code> key to close the modal</li>
<li>automatic focus trapping that prevents any tabbing within the page behind the modal (users can tab off the page into the browser buttons)</li>
<li>the JS functions <code>.showModal()</code> and <code>.close()</code></li>
<li>if <code>closedby</code> is set to <code>any</code>, clicking outside the modal (anywhere on the backdrop) will also close the modal</li>
<li>automatic return of focus to the element that triggered the modal</li>
<li>the <code>autofocus</code> attribute for in-modal elements to set which element should receive focus on opening the modal</li>
<li>the <code>open</code> attribute which is set on the <code>&lt;dialog&gt;</code> when open and removed when closed (when you use the functions mentioned previously)</li>
</ol>
<p>and more. This is just the pieces in use for me. There's also things like <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog#additional_notes" target="_blank" rel="external">setting forms so that submission closes the dialog</a> (point 1 in that list).</p>
<h3 id="what-doesnt-it-give-us">what doesn't it give us?</h3>
<ol>
<li>a close button - gotta roll your own and attach the requisite <code>.close()</code> call (or rely on users hitting escape or clicking the backdrop)</li>
<li>prevention of scroll on the rest of the page</li>
</ol>
<h3 id="a-bug">a bug</h3>
<p>MDN warns:</p>
<blockquote>
<p>Do not add the <code>tabindex</code> property to the <code>&lt;dialog&gt;</code> element as it is not interactive and does not receive focus.</p>
</blockquote>
<p>— <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog#additional_notes" target="_blank" rel="external"><code>&lt;dialog&gt;</code>: additional notes</a> (point 3 in that list).</p>
<p>despite this, I found that in Firefox (but not Edge), the <em><code>&lt;dialog&gt;</code> itself was focusable</em>. I have no idea why, but I tested this on a totally unstyled and unmodified page and still found it to be true. As a focusable element, it made no sense. It had no interactivity and could not be activated.</p>
<p>I'm still torn: do I add <code>tabindex=&quot;-1&quot;</code>? MDN specifically says not to, but I'm pretty sure they're warning against making it <em>focusable</em>. Why warn against making it nonfocusable when <em>it's not supposed to be focusable in the first place</em>, after all?</p>
<p>At current, I'm ambivalent, but I've added <code>tabindex=&quot;-1&quot;</code> to handle Firefox's poor behavior. Making the dialog focusable is unhelpful and confusing.</p>
<h2 id="in-addition-to-the-dialog">in addition to the <code>&lt;dialog&gt;</code></h2>
<p>here's what else I wrote...</p>
<h3 id="html">html</h3>
<p>besides the <code>&lt;dialog&gt;</code>, I gave my <code>&lt;img&gt;</code> elements <code>tabindex=&quot;0&quot;</code> to make them focusable.</p>
<h3 id="js">js</h3>
<p>in <code>modal.js</code>, I created an <code>openDialog()</code> function that takes in the clicked image. It:</p>
<ul>
<li>creates a new <code>&lt;img&gt;</code> element and copies over the <code>src</code> and <code>alt</code> attributes - importantly, it doesn't copy the full <code>&lt;img&gt;</code> because we <em>don't</em> want to copy that <code>tabindex</code> attribute</li>
<li>replaces the current <code>&lt;img&gt;</code> in the modal with our new copy with <code>replaceChild()</code> (or if there's no current one, it just appends)</li>
<p>I gave my close button two event listeners, one that listens for click events and one that listens for a keydown of the space or enter keys. In the case of the keydown, it calls <code>event.preventDefault()</code> to stop the space key from scrolling the underlying page.</p>
<p>I also looped through all images and attached my <code>openDialog()</code> function to any image with a <code>tabindex</code> attribute (I had some images that weren't intended to be fullscreened, so they lacked <code>tabindex</code>). Again, I gave them listeners on both click and keydown.</p>
<h3 id="css">css</h3>
<p>here's the most relevant parts of the CSS:</p>
<ul>
<li><code>dialog::backdrop</code> was given a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Colors/Using_relative_colors" target="_blank" rel="external">relatively calculated</a> color - <code>rgba(from var(--color-bg) r g b / .8)</code> - as well as a blur</li>
<li><code>body:has(dialog[open])</code> has <code>overflow: hidden</code> set</li>
<li><code>dialog img</code> uses a <code>max-height</code> as well as <code>object-fit: contain</code></li>
<contenttype="html"><p>recently I wrote <em>several</em> sites using <a href="https://www.11ty.dev/" target="_blank" rel="external">Eleventy</a> (4? 5?). Including, over the past few days, rewriting this one! That's right, if you're reading this, we're now running on 11ty and hosted by <a href="https://heckin.technology/" target="_blank" rel="external">heckin.technology</a>. See ya, GitHub. Won't miss ya.</p>
<p>Originally, I compiled some of the things I've learned in a standalone site.</p>
<p>however, since I don't know how much I'll focus on that specific site - it is mostly a sample - I am re-publishing the most useful information here. I'll skip the intro to Markdown content. I'm also going to update them where I've learned more or to better match what's represented on this site.</p>
<p>this will comprise of 4 parts: <a href="https://leecat.art/eleventy-lessons/#related-posts">related posts</a>, <a href="https://leecat.art/eleventy-lessons/#featured-images">featured images</a>, <a href="https://leecat.art/eleventy-lessons/#pagination">pagination</a>, and <a href="https://leecat.art/eleventy-lessons/#tag-image-preview">tag image preview</a>. Feel free to jump ahead, as none depend on the others.</p>
<p>by default, the <a href="https://leecat.art/eleventy-lessons/github.com/11ty/eleventy-base-blog" target="_blank" rel="external">Eleventy base blog</a> comes with pagination between posts. Post 2 can take you to posts 1 and 3, etc.</p>
<p>while that is useful for <em>this</em> site, when building another site I wanted to see a couple randomly-suggested posts that shared 1 or more tags.</p>
<p>I started by referring to <a href="https://github.com/11ty/eleventy/discussions/2534" target="_blank rel=external&quot;">this GitHub issue about related posts</a>. I had to fix a few errors that arose from the suggested code.</p>
<p>I also wanted to make three changes:</p>
<ol>
<li>I didn't want to just see posts that shared <em>all</em> tags, but rather posts that shared <em>any</em> tag</li>
<li>I wanted to randomly add a few posts instead of just getting whatever was first (with a shared tag) in the post order</li>
<li>I wanted to exclude the posts that I could reach with between-post pagination</li>
<p>I used this in my post layout. <code>filterTagList</code> comes with the base blog by default, and removes the tags &quot;posts&quot; and &quot;all.&quot; <code>head</code> also comes with the base blog. <code>postlist.njk</code> is my modified-from-the-base-blog post layout.</p>
<pre class="language-html"><code class="language-html">{% set relevantTags = tags | filterTagList %}
{% set olderPost = collections.posts | getPreviousCollectionItem %}
{% set newerPost = collections.posts | getNextCollectionItem %}
{% set urlsToExclude = [page.url, olderPost.url, newerPost.url]}
<p>images in 11ty use the <a href="https://www.11ty.dev/docs/plugins/image/#eleventy-transform" target="_blank" rel="external">Image Transform Plugin</a>. I found it hard to find anything to reference while building this - a lot of sites in the template gallery are either text-heavy or not using the plugin - so I'm reproducing what I've got here for reference.</p>
<p>for any given post, my front matter references the image in this manner:</p>
<pre><code>---
image:
src: sample-0.jpg
alt: moss on a fencepost
---
</code></pre>
<h3 id="image-html-transform">image HTML transform</h3>
<p>As mentioned, there's a plugin for images. If you started with the base blog, in <code>eleventy.config.js</code>, you'll probably find a chunk of code similar to this already in place:</p>
<p>setting <code>formats</code> to &quot;auto&quot; helps - use whatever type of image you want, get that type out. The default settings that came with the Eleventy base blog didn't set a <code>width</code>, which I wanted (by default, images off my camera - like the hellebore featured image for this post - are almost 5k pixels wide). I also found it helpful to set <code>failOnError</code> to true for a little more feedback.</p>
<blockquote>
<p>NOTE: It sure seems like Eleventy will fail your image processing if there's no alt text. While admirable, it would be nice if I could find any documentation for this!</p>
<p>I needed images to show up in 3 places:</p>
<ul>
<li>In the lists of posts on the home page, I wanted each post to show its featured image</li>
<li>In the &quot;related posts&quot; section on each individual post, I wanted each related post to show its featured image</li>
<li>And of course, I wanted the post to show its own featured image</li>
</ul>
<h3 id="home-page-and-related-posts">home page and related posts</h3>
<p>both of these sections use the same template, which in my setup is called <code>postlist.njk</code>. Within the relevant links, I added the following:</p>
<pre class="language-html"><code class="language-html">{% if post.data.image.src %}
<p><a href="https://www.11ty.dev/docs/pagination/" target="_blank" rel="external">Post pagination in Eleventy is pretty straightforward</a>, mostly requiring some specific front matter.</p>
<p>The home page pagination I have set up here looks like the following (in <code>index.njk</code>):</p>
<pre><code>---
pagination:
data: collections.posts
size: 13
alias: posts
reverse: true
---
</code></pre>
<p>6 posts per page, paginate data from <code>collections.posts</code> which we'll call just <code>posts</code> for short, and do it in reverse (aka, most recent posts show first).</p>
<p><a href="https://www.11ty.dev/docs/pagination/nav" target="_blank" rel="external">You'll also likely want previous and next buttons</a>. I did. Here's what I have...</p>
<p>There's two components to this, the bigger one being this <code>pagination.njk</code> template. Look, I like my little icons, ok? It takes an <code>olderHref</code> and a <code>newerHref</code>, and optionally an <code>olderTitle</code> and <code>newerTitle</code>.</p>
<pre class="language-html"><code class="language-html">{% if olderHref or newerHref %}
<p>however, there's a catch. <a href="https://www.11ty.dev/docs/quicktips/tag-pages/" target="_blank" rel="external">Tag pages are <em>created</em> via pagination</a>! It's a lot harder to paginate those - you can't just use the front matter to set it up.</p>
<p>I untangled <a href="https://github.com/11ty/eleventy/issues/332#issuecomment-445236776" target="_blank" rel="external">this GitHub issue about double-layered pagination</a> and came to the following solution...</p>
<pre class="language-js"><code class="language-js"><span class="token comment">// note that this uses the lodash.chunk method, so you’ll have to import that</span>
{% include "pagination.njk" %}</code></pre>
<p>note the pagination checking <code>tag.pageNumber</code> against <code>tag.PageSize</code> - the <a href="https://github.com/11ty/eleventy/issues/332#issuecomment-445236776" target="_blank" rel="external">original suggested solution</a> in the GitHub post creates an issue where the pagination loops through <em>all</em> of the tag pages bit-by-bit. This sorts that - hat tip to <a href="https://github.com/11ty/eleventy/issues/332#issuecomment-1248185406" target="_blank" rel="external">TheReyzar who mentioned the issue and showed part of their solution</a>.</p>
<p>finally, in my <code>filters.js</code> file, I add the <code>tagPagination</code> tag to the tags that get filtered using <code>filterTagList</code>:</p>
<p>today I tackled making the tag page more visually interesting.</p>
<h3 id="preview-the-first-featured-image">preview the first featured image</h3>
<p>first, I worked on previewing the first featured image. The focus here is on digging into <code>collections[tag]</code> (reversed!) to get to the data of the first post.</p>
<h3 id="preview-a-collage-of-recent-featured-images">preview a collage of recent featured images</h3>
<p>I found that having just the first featured image made the tag page hard to differentiate from any of the pages listing individual posts, so from there I moved to showing 4 images (or empty rectangles where there weren't four to show).</p>
<p>this had worked so far because the photos on the lessons site are from my camera in landscape mode, producing neat, identical 3:2 aspect ratios. Let's throw a wrench in that and introduce a portrait-mode photo.</p>
<p>thankfully, the CSS property <code>aspect-ratio</code> makes this pretty straightforward, and <code>object-fit</code> finishes the job.</p>
<p>(I also set the <code>missing-img</code><code>&lt;div&gt;</code>s to have the same aspect ratio.)</p>
<hr>
<p>There's the good stuff from <a href="https://inherentlee.codeberg.page/lessons/" target="_blank" rel="external">11ty Lessons</a>. Hope you enjoyed.</p>
<p>recently, I've been working on a <a href="https://inherentlee.codeberg.page/spoonfairies/" target="_blank" rel="external">website for a project called spoonfairies</a>. On the providers page, we list a series of names along with their pronouns, location, and services offered. Visually, it looks like this:</p>
<p><img src="https://leecat.art/img/spoonfairies-provider.png" alt="A provider listing from spoonfairies. On the top row of text, it shows the provider's name in large purple text, then their pronouns in slightly opaque white and slightly smaller font, then aligned on the right, a map pin emoji and their general location in standard size white text. On the second row of text, it lists a few services the provider offers, comma separated." loading="lazy" decoding="async" width="1000" height="147"></p>
<p>at first, all three pieces of information in the top row had no extra styling - it was just a line of text with the same color and size throughout. The location bit also didn't exist yet, so we're going to briefly ignore it. Screenreader testing (with NVDA, specifically) informed me that, when reading through a long list of providers, parentheses become <em>very</em> irritating. Imagine hearing the following:</p>
<blockquote>
<p>Lorem Ipsum left parentheses she slash her right parentheses web accessiblity webdev. Dolor Sit left parentheses they slash them right parentheses housecleaning. Amet Consectetur left parentheses he slash him right parentheses webdev spreadsheets software.</p>
<p>put the pronouns in a span that provides special styling, and use <code>::before</code> and <code>::after</code> to apply parentheses.</p>
<p><strong>the slash is the magic there.</strong> The string before the slash indicates the visual content, and the string after the slash is the alternative text content. I went happily on my way.</p>
<p>plus, this is neat - now I can style the pronouns separately. Let's make them the standard text color rather than the link color, and a bit smaller, and a smidge opaque... nice.</p>
<p>I even added actual alternative text rather than an empty string to provide some context. Pronouns, I figured, could exist without much context, as it's pretty common for them to follow directly after names in introductions, but location isn't as much of a given.</p>
<p>again, style em up nice, more of a standard text look, right-aligned. Cool.</p>
<h2 id="a-bigger-problem-than-parentheses">a bigger problem than parentheses</h2>
<p>...then I did some screen reader testing. Which I should have done directly after the pronouns bit. Turns out, I wasn't thrilled with what the <code>&lt;span&gt;</code>s did.</p>
<p>at least with fairly default settings in NVDA, the <code>&lt;span&gt;</code>s broke up the way the link was read out. Suddenly, I was getting:</p>
<blockquote>
<p>visited link Lorem Ipsum visited link she slash her visited link Tacoma</p>
</blockquote>
<p>this is all one link, mind you. The <code>&lt;a&gt;</code> tag isn't broken into three links. But the <code>&lt;span&gt;</code>s apparently break up the screen reader output anyway (in NVDA, that's a continual caveat).</p>
<p>I moved away from my <code>content</code> approach entirely (well, I kept it around as a failsafe, but it's not running the show now). Instead, I switched over to an <code>aria-label</code> for the whole link.</p>
<span class="token attr-name">aria-label</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Lorem Ipsum she/her is based out of Tacoma<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
<p>(technically, all this is templated to hell and back. I would hope that's obvious given I'm talking about <em>lists</em> of these entries.)</p>
<p>now, after more screen reader testing, it reads out smoothly. The <code>aria-label</code> precludes the actual link text and cleanly says what needs to be said, with nothing breaking up the text and the whole thing easily recognized as one link. <em>And</em> I've got my fancy styling. Sweet.</p>