Accessibility
Understanding aria-roledescription
This article explains aria-roledescription in plain language, starting with how native and ARIA roles work, then showing how it can override how a role is announced, without creating a new role.
Testing flashing content for accessibility issues
How can people with seizure and vestibular disorders test flashing content? What about testers who are prone to headaches, dizziness, and nausea? Can automated tools take care of this task? Steve Frenzel investigates in this article.
Accessible Fallback HTML for Canvas Elements
Our accessibility team researched potential ways to make the activities more accessible and discovered that Canvas elements are designed to have fallback HTML in case they don’t load, which can be harnessed for accessibility. By having fallback HTML the screen reader can read out what’s on the screen. Interactive elements, such as links and buttons, can also be linked to images and text on the Canvas with JavaScript, to mimic that interactivity and add focus states when using a keyboard.
Chrome is currently working on making this into a default in-built browser feature. Exposing the HTML content inside the Canvas element to the browser itself with the content="drawable" attribute in order to improve accessibility. However this is not standard practice yet and has limited browser support.
CSS
astro-reveal — Scroll reveal animations for Astro. Zero JS by default
Scroll reveal animations for Astro. Zero runtime JS with native scroll-driven animations (purist mode) or a tiny 0.6 KB observer. UI-agnostic, accessible, FOUC-proof.
CSS Grid of Random Shapes (Mosaic Style)
Tired of classic and boring CSS grids with rectangles? Let's random() the shapes and create mosaic-style grids.
GitHub Ditches CSS-in-JS for CSS Modules, Reports 55% Faster SSR after Three-Year Migration
GitHub has published an in-depth account of a three-year effort to move github.com off CSS-in-JS and onto CSS Modules, reporting a 55% reduction in server-side rendering time and 25% faster component initialisation across its Primer-powered design system.
CSS timeline-scope: One Scroll, Multiple Carousels
When an element tracks a timeline, like a scroll timeline or view timeline, that timeline can drive an animation in any of the parent element’s children or descendants because they’re all in scope. One scroll, many elements.
Creating Beveled Corners with “corner-shape”
The new corner-shape CSS property is incredibly useful, but if we really want to get the most out of it, we need to use some surprisingly-sophisticated tricks. In this post, I’ll share how I’ve used this new property to create a retro-sci-fi aesthetic with diagonal corners everywhere.
Responsive Mosaic Grid using Modern CSS
Improving the previous mosaic grid implementation with a responsive version that works with any number of elements. Powered by random(), ident(), border-shape, sibling-*() functions, and more.
Elastic/Stretching UI With CSS Anchors
Opposing insets normally stretch a positioned element across its container. Point those insets at CSS anchors instead, and you get an element that stretches between anchors, which is exactly what you need for a stretchy selection indicator that snaps from one option to the next.
Style Queries as Conditional Modifiers
Where style queries shine is when the condition and the styles need to live in different places, or when one condition needs to affect several things at once: components that keep working, and adapt sensibly, no matter where they end up.
CSS Units Explained: px, em, rem, %, vw, and clamp()
Learn when to use px, em, rem, percentages, and viewport units in CSS, why rem respects people's font settings, and how clamp() makes sizes fluid.
HTML
HTML esoterica - en-GB vs en_GB
Explains the difference between language tags and locale identifiers in HTML.
style in body is now valid HTML
The HTML validator was recently updated. It is now valid to include a <style> element inside the <body> rather than the <head> - albeit only when meeting certain conditions. While this has always worked in browsers, until recently it was not technically valid.
Here are the rules for using <style> inside of <body>:
- The
styleelement must be the first child of its parent. - All rules inside the
styleelement must be inside a@scoperule.
JavaScript
NitroUI | Build native apps with React and TypeScript
Build native iOS and Android apps with React and TypeScript. Real UIKit and Android views, with Swift and Kotlin one call away.
Hidden Form Fields Can Still End Up in Your API Requests
Why switching between conditional React form fields doesn't necessarily clear their values, and how to prevent stale data from reaching your backend.
Miscellaneous
If you stop writing code, you also get worse at reviewing it
Before 2022, 10/10 engineers would agree wholeheartedly. Somehow it changed (?!)