to ✨ Modern ✨ Web Design
These are all different expressions and ways to describe what are ultimately similar intents.
“ What would happen if we stopped treating the web like a blank canvas to paint on, and instead like a material to build with? ”
—Frank Chimero, 2015
Peddlers of complex frontend frameworks & build tooling have been advertising their solutions as “modern” for the past ~15 years.
But I’m here to argue there’s nothing more “modern” (in an evergreen sense) than the granular approach to Web Design…
And explore some of these materials and dialects, (re)discovering the joys of “Granular”
frontend programming.
Bridgetown employs a hybrid architecture, featuring elements of both static site generation (forked from Jekyll, now rewritten to be much more powerful) and dynamic server routing (powered by Roda & Rack under the hood). It has a fully-featured frontend pipeline powered by esbuild (more on that shortly).
(and modern flavors thereof)
The amount of progress just in the last few years for each of these materials has been staggering.
The Interop project has yielded tremendous results, and the Baseline initiative lets us feel confident adopting new technologies regularly as support becomes widespread. It’s glorious.
But let’s go a step further and look at some newly re-imagined methodologies for each of these materials…
HTML-Over-The-Wire (Hotwire Turbo)
htmx
Alpine.js
Datastar
Unpoly
i-html
Triptych (future browser APIs?!)
Roll-your-own with fetch (Ajax’s Revenge!)
State (live data) and in some cases behavior directives can live directly within markup.
“HTML fragments”, not-quite-full-page-reloads, commands, and in some cases DOM morphing are fundamental building blocks of the UX.
The “SPA” way of doing things has you loading & saving JSON state via a “frontend application” that’s essentially decoupled from backend APIs. Interactivity is driven by heavy JS code bundles.
Whereas in Hypermedia, there is no fully-decoupled frontend / backend split. It is a holistic full-stack application.
It’s dramatically simpler to reason about for many categories of web apps, and the savings in performance and “frontend churn” is substantial.
Many different languages offer hypermedia-friendly full-stack frameworks—you’re not limited to just JavaScript.
And perhaps most importantly, you’re working with the grain of the web, instead of against it.
“ A design system is a comprehensive set of standards, documentation, and reusable components that guide the development of digital products within an organization.
It serves as a single source of truth for designers and developers, ensuring consistency and efficiency across projects. ”
—Wikipedia
CSS Custom Properties (Variables)
for Design Tokens
Scoping in both Light DOM & Shadow DOM
Cascade Layers for organizing different
Design System functions
Nesting to make DOM structure clear
within a stylesheet
“Intrinsic” features: grid, container queries, responsive type, clamp, etc.
From Brad Frost, well-known expert in design systems thinking:

Instead of a feature being scattered across “web pages” containing a bunch of nebulous HTML templates, it is now a progression. The Atomic Design Process:

All of the features you need for clean, maintainable, future-proof CSS architecture are now built into the platform. We’ve arrived.
V4 of Tailwind is a rearchitecting of the controversial framework around native CSS-based design tokens and a modular rather than viral build approach. The war is over. Vanilla won. 🎉

Most components up to and possibly even including the page template level can be defined via markup containing Custom Elements (aka Web Components).
<h2>Informational Card</h2>
<p>Here is some content in the card.</p>
<a href="...">Link to Somewhere</a>
<h2 slot="header">Informational Card</h2>
<p>Here is some content in the card.</p>
<a href="..." slot="footer">Link to Somewhere</a>
<ds-card>
<h2 slot="header">Informational Card</h2>
<p>Here is some content in the card.</p>
<a href="..." slot="footer">Link to Somewhere</a>
</ds-card>
<ds-card>
<h2 slot="header">Informational Card</h2>
<p>Here is some content in the card.</p>
<a href="..." slot="footer">Link to Somewhere</a>
</ds-card>
<!-- Shadow DOM -->
<style>
/* */
</style>
<header><slot name="header"></slot></header>
<div><slot></slot></div>
<footer><slot name="footer"></slot></footer>
<ds-card>
<template shadowrootmode="open">
<style>
/* */
</style>
<header><slot name="header"></slot></header>
<div><slot></slot></div>
<footer><slot name="footer"></slot></footer>
</template>
<h2 slot="header">Informational Card</h2>
<p>Here is some content in the card.</p>
<a href="..." slot="footer">Link to Somewhere</a>
</ds-card>
JavaScript is optional! Start by just replacing <div class="foo"> markup everywhere with elegantly named custom elements.
<div class="navbar"><nav>...</nav></div>
can be become <nav-bar><nav>...</nav></nav-bar>.
nav-bar {
--add-tokens-here: calc(var(--spacing) * 2);
> nav {
/* style DOM structure */
> ul {
/* and so */
> li {
/* it goes */
}
}
}
}
class EditItem extends HTMLElement {
static {
customElements.define("edit-item", this)
}
connectedCallback() {
this.addEventListener("click", this)
}
handleEvent(event) {
if (event.type === "click") {
/* perform an action here */
}
}
}
<edit-item>
<button>Edit Item</button>
</edit-item>
There’s been a lot of ink spilled in this area…I would argue too much. 😅
My pitch is simple: Web Components technology is the future of the frontend. And not just the future…they’re already here and very likely in many of the applications you’re already using.
(like it or not)
Enough with “globals”! We can write HTML that’s centered around components, write CSS that’s scoped, and organize our JavaScript inside of layered component trees. Hello encapsulation. 😎
Maintainable and sustainable frontends aren’t just a pipe dream. There’s here, they’re real, and they’re awesome.
(It’s actually gotten pretty good. Really!)
(Yes, I’m even looking at you Turbo/Stimulus fans. You’re not exempt from my scrutiny! 😄)
Seek out frameworks, projects, and proposals which come from community-minded people championing Diversity, Equity, Inclusion, & Accessibility—not the racism & bigotry of the past.
We can all do our part to make this industry we love work better for everyone, everywhere.