A collection of thoughts about HTML, CSS, JavaScript, UX, a11y, web standards, and related things. Posts by Cory LaViska.
Finding the active element in a shadow root
You can get the focused element with document.activeElement
but, if it's inside a shadow root, this will be the host element. This happens because of retargeting, but sometimes you might need access to the internal element that actually has focus.
Moving from Stencil to LitElement
Over the weekend, I finished migrating Shoelace from Stencil to LitElement. Even though consumers of the library won't see much of a difference, this was a major overhaul of Shoelace's internals.
SVG Repo
I stumbled upon a great resource for free SVGs. They're currently boasting over 300,000 images. Check it out over at SVG repo.
Archiving Postleaf
Postleaf — at least in its current form — has been discontinued. In the future, I'd like to bring it back as something different. Maybe an open source project. Maybe a SaaS product. I'm not sure at this point.
Getting localized month and day names in the browser
JavaScript has a well-supported date/time formatting API called Intl.DateTimeFormat
. Here's a tip — you can use it to generate localized month and day names without the need for a language pack! This is super useful if you're building, say, a date picker or a calendar app.
Cory's amazing dot paper
In a world where designers use Sketch, Photoshop, and other apps to create wireframes, I'm here in my corner holding this old fashioned pencil and a stack of dot paper.
A free HTML, CSS, and JavaScript beautifier
Ten years ago, I launched DirtyMarkup to clean up dirty code. It was a fun little tool, but its best feature was that it was easy to use and didn't have intrusive advertisements.
Let's Encrypt renews but browsers still seeing old/expired SSL certificate
This morning was frustrating. I recently upgraded my VPS from the deprecated letsencrypt
client to the newer cerbot
client and generated new certificates for all my personal domains. I thought everything was fine — until I kept seeing intermittent SSL errors.
Introducing Surreal CMS 7
Last November was the 10 year mark for Surreal CMS, a content management service I created to manage static (and mostly static) websites.
Feeds available in Atom & JSON
Explore the archive for additional posts or press / to search.