Build a Personal Site with Eleventy and Hand-Written CSS

The stack behind brennan.day: Eleventy and Nunjucks, hand-written CSS with a Gruvbox palette, Netlify hosting and Pagefind search, plus the accessibility choices made from the start.

By
Brennan Kenneth Brown
Published
Reading time
5 minutes
Level
Intermediate
You need
  • Basic HTML and CSS
  • Node.js installed
The Gruvbox color palette: named red, green, yellow, blue, purple and aqua swatches with background and foreground grays
The color palette used in brennan.day

This guide shows how a personal website is built with Eleventy, Nunjucks and hand-written CSS, using brennan.day as the example, and how to set up the same stack yourself. It covers the tech stack, a 3,500-line vanilla CSS stylesheet with a Gruvbox palette, a few CSS features (rainbow accents, heading anchors, external-link icons) and the accessibility choices. I previously built a Jekyll theme called Enjoyment Work with digital garden features, but its build times were slow and the code was messy. My lesson from that was to design what I will use rather than what I want to use. This site is the result.

What is the tech stack?

The site also has a colophon, the web version of a book's production notes. Here is the stack:

  • Static Site Generator: Eleventy v2.0+
  • Template Engine: Nunjucks for layouts, Markdown for content
  • Styling: No CSS frameworks, vanilla CSS with a Gruvbox-inspired color scheme
  • Hosting: Netlify (though it could be anywhere)
  • Domain: brennan.day via Porkbun
  • Search: Pagefind for static, client-side search

I used Jekyll for years but moved to Eleventy because it is JavaScript-based, so you can use the npm ecosystem. It's zero-config by default but incredibly configurable when needed. It's also rather opinionless about how your content should be structured, which can be too open-ended for some.

// The entire Eleventy configuration is under 400 lines
module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(pluginRss);
  eleventyConfig.addPlugin(syntaxHighlight);
  // ... a few more plugins and filters
  return {
    templateFormats: ["md", "njk", "html"],
    dir: { input: "src", output: "_site" }
  };
};

There are no Ruby dependencies leading to complex build chains. This results in my build times going from minutes in Jekyll to single-digit seconds.

My local development server starts instantly with npm start, and the production build with npm run build generates the complete site in under 10 seconds on my machine.

{
  "scripts": {
    "start": "eleventy --serve",
    "build": "eleventy && npx pagefind --site _site",
    "clean": "rimraf .eleventy-cache _site"
  }
}

How do I write CSS without a framework?

I wrote all the CSS for this site from scratch. Frameworks come with their own opinions and extra weight, and writing it myself helps performance and learning, at the cost of reinventing some wheels.

The stylesheet is currently over 3,500 lines long, organized with a table of contents. It starts with CSS custom properties (variables), establishes a design system, then builds from base styles up to components.

The color palette is based on Gruvbox, a popular colorscheme designed for people who spend a long time looking at a terminal. As per the original designer:

Designed as a bright theme with pastel 'retro groove' colors and light/dark mode switching in the way of solarized. The main focus when developing gruvbox is to keep colors easily distinguishable, contrast enough and still pleasant for the eyes.

:root {
  /* Light mode */
  --bg: #fbf1c7;
  --fg: #3c3836;
  --accent-primary: #cc241d;
  
  /* Dark mode overrides */
  &.dark-mode {
    --bg: #282828;
    --fg: #ebdbb2;
    --accent-primary: #fb4934;
  }
}

The nice thing with this palette is that light mode text exceeds WCAG AA standards, dark mode is even better for users with light sensitivity, links are clearly distinguished from regular text, and focus states use high-contrast colors.

How do I add rainbow accents with CSS variables?

The site uses rainbow accents throughout. Their aesthetic encourages individuality and acceptance. In design, they are related to hope, relief after difficult times, and new beginnings, and are used to represent diversity and joy. These are values I want the site to reflect. Aarron Walter's hierarchy of user needs states pleasure and delight sit at the top of the pyramid, achievable only after foundational needs like functionality and usability are met. The site needs to work first, then delight. Surprise and delight in design involves unexpected elements that bring joy or amusement.

The accents are meant to add positive emotion without hurting readability. The palette is defined as CSS variables:

/* Navigation rainbow colors */
--nav-red: #cc241d;
--nav-orange: #d65d0e;
--nav-yellow: #d79921;
--nav-green: #98971a;
--nav-aqua: #689d6a;
--nav-blue: #458588;
--nav-purple: #b16286;

These colors cycle through navigation links, footer links, and the card design on the slash-pages and accounts page. Each navigation item gets its own color from the rainbow sequence.

The /slash-pages and /accounts pages use the same card-based grid system with rainbow accents, with each card getting an accent colour from the rainbow sequence:

.verify-card {
  --card-accent: var(--nav-red);
  background: var(--bg-alt);
  border: 2px solid var(--border);
  padding: 1.5rem;
}

.verify-card:nth-child(7n + 1) { --card-accent: var(--nav-red); }
.verify-card:nth-child(7n + 2) { --card-accent: var(--nav-orange); }
.verify-card:nth-child(7n + 3) { --card-accent: var(--nav-yellow); }
.verify-card:nth-child(7n + 4) { --card-accent: var(--nav-green); }
.verify-card:nth-child(7n + 5) { --card-accent: var(--nav-aqua); }
.verify-card:nth-child(7n + 6) { --card-accent: var(--nav-blue); }
.verify-card:nth-child(7n + 7) { --card-accent: var(--nav-purple); }

The /slash-pages page is inspired by the slash pages movement, a collection of useful, human-focused pages. A site map with personality. Each link includes a brief description and an icon, making navigation intuitive.

The /accounts page is a verified public list of all the accounts I control across the web. This is part of the IndieWeb approach to identity, instead of trusting a platform's verification system, you verify by linking from your own domain.

Next, the site title in the top right gets special treatment with an animated rainbow that flows on hover on desktop:

.weblog-title a:hover {
  animation: rainbow-wave 1.5s ease-in-out infinite;
}

The navigation stays fixed at the top as you scroll, with a rainbow progress bar showing how far you've read down the page:

.site-header {
  position: sticky;
  top: 0;
  --scroll-progress: 0;
}

.site-header::after {
  background: linear-gradient(90deg,
    var(--nav-red), var(--nav-orange), var(--nav-yellow),
    var(--nav-green), var(--nav-aqua), var(--nav-blue), var(--nav-purple));
  transform: scaleX(var(--scroll-progress));
}

JavaScript updates the progress value as you scroll, which gives a reading-progress indicator on longer articles.

Every heading gets an anchor link automatically, hidden until you hover:

h1 .header-anchor::after { content: " #"; }
h2 .header-anchor::after { content: " ##"; }

.header-anchor {
  opacity: 0;
  transition: opacity 0.2s ease;
}

h1:hover .header-anchor,
h2:hover .header-anchor {
  opacity: 1;
}

This keeps the page clean while still making it easy to link to specific sections. The number of # symbols matches the heading level for visual clarity.

External links, such as omg.lol, get a small arrow indicator (➚) to show they leave the site:

a[href^="http://"]:not([href*="brennan.day"]):not(.no-external-icon)::after,
a[href^="https://"]:not([href*="brennan.day"]):not(.no-external-icon)::after {
  content: "➚";
  font-size: 0.75em;
  margin-left: 0.2em;
  vertical-align: super;
}

The not(.no-external-icon) exception lets me disable the arrow on specific links where it would be redundant (like badge images or my book covers).

How do I build accessibility into the site?

I treat accessibility (a11y) as a foundation, with WCAG 2.1 AA as the minimum. For a step-by-step list of fixes, see the web accessibility checklist. The site starts with proper semantic structure:

<!-- Skip link for keyboard navigation -->
<a href="#main-content" id="skip-to-content">Skip to main content</a>

<!-- Proper landmarks -->
<main id="main-content" aria-label="Main content">
<section aria-label="Posting activity">
<footer role="contentinfo">

Landmarks let screen reader users jump between sections. Keyboard navigation, focus indicators and reduced-motion support work without a mouse.

/* Clear focus indicators */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

Respecting user preferences is essential. The site detects and honours prefers-reduced-motion:

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

The rainbow wave effect, scroll animations and hover transitions all respect this setting.

For screen readers, images have meaningful alt-text (that can be viewed by hovering over an image on desktop), icons use aria-hidden="true" when decorative, and forms have proper labels and descriptions. Screen reader-only text is available when needed:

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  /* Hidden visually, available to screen readers */
}

I test regularly with screen readers (VoiceOver, NVDA), keyboard-only audits, color contrast tools and feedback from people with disabilities.

What are the next steps?

For IndieWeb features, feeds and offline support on the same site, see Eleventy Recipes: Git Hash, Last Modified, Feeds, Offline, WebSub. To improve performance, see Improve Your Lighthouse Score.