Melin's Blog

Latest posts

See all posts
  • Cleverly Using CSS `var()` Variables to Implement Arbitrary Custom CSS Syntax
    CSS custom properties are usually introduced as reusable values: But they are more powerful than that. A custom property can store almost any token sequence, including syntax th...
  • ES6 Template Strings in HTML Template Rendering
    ES6 template strings, also called template literals, are one of those JavaScript features that feel small at first, then quietly remove a lot of friction from everyday UI work....
  • On a Sunday afternoon, while sitting in my study, I suddenly wondered: if an element, such as a `<label>` element, could respond to the state changes of a radio button or checkbox no matter where it is on the page, wouldn’t that make it possible to handle almost every click interaction on the page in one shot? That would be seriously awesome!
    But is it actually that awesome? Let’s take a closer look. The Starting Point: Most Click Interactions Are State Toggles If we strip many common click interactions down to their...
  • Trying JavaScript `IntersectionObserver` to Link Headings and Navigation
    Long documentation pages often need a table of contents that follows the reader. As the user scrolls, the navigation item for the current section should become active. The tradi...
  • It Turns Out the DOM Has a JavaScript API Called `toggleAttribute()`
    For years, when I needed to work with DOM attributes, I reached for the familiar set: These APIs are everywhere. They are old, stable, and easy to remember. So I assumed that wa...
© 2026 • Melin
Press Esc or click anywhere to close