Snippets

A central repository for my most-often-used snippets of code. I maintain this mostly for my own use throughout different projects, but I've also annotated each snippet to explain its purpose and why I use it.

  • Accessible Linked Cards
    Method for developing clickable linked cards without sacrificing the user experience for screen reader users
    HTML
    JavaScript
    A11y
  • Aspect Ratio
    Force an element to maintain a given aspect ratio
    CSS
  • Dashed Border Length
    A CSS-only solution to controlling segment-length of dashed borders
    CSS
  • Focus Styles
    Remove and/or replace browser-default focus styles without impeding the experience of mouse users or tab-navigation
    JavaScript
    CSS
    A11y
  • Responsive Font Sizes
    Responsively scale down font sizes for smaller devices, with 1rem (16px) as the baseline
    HTML
    CSS
    A11y