Search
Accessible Forms with Pseudo Classes
22.3.2024
Hey all you wonderful developers out there! In this post, I am going to take you through creating a simple contact form using semantic HTML and an awesome CSS pseudo class known as :focus-within. The :focus-within class allows for …
Accessible Forms with Pseudo Classes originally published...
How We Improved the Accessibility of Our Single Page App Menu
25.2.2021
I recently started working on a Progressive Web App (PWA) for a client with my team. We’re using React with client-side routing via React Router, and one of the first elements that we made was the main menu. Menus …
The post How We Improved the Accessibility of Our Single Page App Menu...
Fixing Smooth Scrolling with Find-on-Page
13.1.2021
Back when we released the v17 design (we’re on v18 now) of this site. I added html { scroll-behavior: smooth; } to the CSS. Right away, I got comments like this (just one example):
… when you control+f or
…
The post Fixing Smooth Scrolling with Find-on-Page appeared first...
CSS background-repeat: round
23.6.2020
The CSS spec is full of gems that sneak their way past most of us web designers and developers. Stuff like :focus-within, prefers-reduced-motion, and prefers-color-scheme suddenly make their way into CSS without us really finding out for months or years. One such example is background-repeat:...
How to Create a “Skip to Content” Link
17.3.2020
Skip links are little internal navigation links that help users move around a page. It’s possible you’ve never actually seen one before because they’re often hidden from view and used as an accessibility enhancement that lets keyboard users and screen readers jump from the top of the page to...
Don’t comma-separate :focus-within if you need deep browser support
24.7.2019
I really like :focus-within. It's a super useful selector that allows you to essentially select a parent element when any of its children are in focus.
Say you wanted to reveal some extra stuff when a <div> is hovered...
div:hover {
.extra-stuff {
/* reveal it */
}
}
That's...
CSS :focus-within
25.6.2019
Using :hover to display additional information or elements is a very useful technique but a big drawback to using the hover pseudo-class is that they are usually not accessibility-friendly. Not everyone uses a mouse and some users have visual impairments, so they rely on screen readers or...
Stuff you can do with CSS pointer events
27.7.2018
Martijn Cuppens (the same fella with the very weird div!) has some more irresistible CSS trickery. Three of the examples are about making a child element trigger an event on a parent element (almost like the magic that is :focus-within).
Here's how I reasoned it out to myself:
You know how if...