# Dentelle

Dentelle case study: ribbons of light for website backgrounds, by Quentin Ecrepont. URL: https://quentinecrepont.com/work/dentelle

A ribbon of light behind any block of a website, in one line of code. It weighs 17 KB gzipped, with 0 runtime dependencies.

An open-source library that draws animated ribbons of light behind website blocks or whole pages, on the GPU.

- Role: Creator & Creative Technologist
- Context: Open-source project
- Period: Nov 2026 - Present
- Location: Tokyo
- Stack: TypeScript, WebGL2, GLSL, Vite, npm, Claude Code
- [Playground](https://quentinecrepont.com/dentelle)
- [npm](https://www.npmjs.com/package/dentelle)
- [GitHub](https://github.com/quentinecrepont/Dentelle)

## TL;DR

Some websites open on a ribbon of light. A few fine threads, twisting slowly behind the headline.

I wanted that on my own projects, with full control over it: how much it twists, how turbulent it gets, which noise shapes it, how it moves. The gradient tools I tried couldn't draw it.

So I built Dentelle.

It's an open-source TypeScript library that puts the ribbon behind a hero, a section, a footer or the whole page. Each thread is a line in 3D space, drawn in WebGL2 and seen through a virtual camera.

I decided how the ribbon looks and moves, and tuned its 3 presets and the range of its 42 options.

The whole library weighs 17 KB gzipped, shaders included, with 0 runtime dependencies.

## The problem

A moving background has one job: set the mood behind the headline, then stay out of the way.

It's easy to get wrong. Push the turbulence and it turns into a lava lamp. Blur it and the threads go soft. Load a video and the page gets heavy.

I wanted light that stays as sharp as vector strokes, moves calmly, and keeps a phone smooth. And every part of it adjustable: the shape, the motion, the camera, the lens and the light.

## My role

I came up with Dentelle and built it with Claude Code. I decided what it should do, and how the light should look and move. I chose the range of every setting, tested each one and tuned the presets.

`README.md`, from line 119:

```md
import { createRibbon } from "dentelle";

const ribbon = createRibbon({
  target: document.querySelector(".hero"), // default: document.body
  preset: "blue-hour",
});
```

All it takes: the Quick Start from Dentelle's README.

## Key decisions

### From a sky to a ribbon

I'm not a physicist. I built a physically based sky anyway. Sunlight scattering through the air, bending near the horizon, a layer of haze.

In a photo taken from a plane at 11 km, a thin red line sits on the horizon. It's a haze layer seen edge-on, lit by a sun that has already set. My sky only drew that line once I added the haze layer.

Then I realized… I was building a sky simulator, not a tool for designers. So I went back to my first idea: the ribbon.

I kept the sky for one preset. Afterglow's 6 colors are sampled from it, from the horizon up to 10° above.

### Turbulence in the lines

My first turbulence warped the finished image. It looked like a cheap filter, with pixelated edges. I threw it out.

A ribbon of light should stay sharp, like vector strokes. Now each thread moves along its own path. The threads stay crisp, however strong the turbulence.

### A real lens

I wanted the blur of a camera lens.

Dentelle finds the nearest and farthest visible parts of the ribbon, and focuses between them. `focus` moves that point. The farther a thread is from it, the blurrier it gets. `aperture` sets how much. `focusRange` widens the sharp zone, from a single plane to the whole ribbon.

The blur takes the shape of the lens diaphragm. `blades: 2` gives round bokeh. From 3 to 9, it becomes a polygon.

Turning the ribbon toward the camera used to make bright starbursts. Thread segments got smaller than a pixel, and their direction went wild. Dentelle now reads each thread's direction over several pixels, and fades segments that get too small.

### Light that behaves like light

Threads add up like light: where they cross, it gets brighter.

Highlights roll off toward white the way film does, instead of clipping. `response` sets when that starts.

Colors blend in OKLCH. A gradient from blue to pink stays colorful in the middle. Next to a near-gray stop, like white, they blend in OKLab instead, so the hue doesn't sweep through other colors on the way.

`colorMix` mixes the colors from one thread to the next. At 1, each thread takes its own color, somewhere along the gradient.

The halo around the ribbon first showed faint stripes above the threads. Dentelle now blurs a smoothed copy of the image, and a visual test checks the stripes stay gone.

### Grain without a pattern

Grain is off by default. When you turn it on, it shouldn't draw a pattern.

My first grain did: a faint repeating texture. It came from the random function, and from resizing the grain to fit the screen. Dentelle now draws it at the screen's own resolution, mostly in the midtones, like film.

### One block, one ribbon

The same settings don't look the same on a 16:9 hero and on a thin footer.

Dentelle frames each block like a camera: a 40° vertical view, and never more than 75° across. On a very wide block, the ribbon doesn't stretch. A shorter `ribbonLength` brings its ends into view, and `endFade` sets how gradually they dissolve.

Backgrounds render at their exact hex value. Give a footer the same color as the page, and you won't see where the block starts.

A ribbon can also go behind the whole page. With `attachment`, the ribbon fills the first screen and scrolls away with the content, or stays fixed behind it. Either way, it's the size of the screen, never the height of the page.

### Smooth on a phone

A ribbon plays behind the text people came to read. It has to stay smooth on an old phone too, in a packed train at 8am.

Every ribbon on a page shares one WebGL context. Each one pauses when it leaves the screen, or when the tab is hidden, and gives its GPU memory back until it returns.

A ribbon that doesn't move isn't redrawn. And Dentelle never draws more than 60 frames per second, even on a 120 Hz screen. A background doesn't need more.

With `quality: "auto"`, Dentelle times its frames every second. When they run late, it drops a level, with fewer segments per thread and a lower internal resolution. Once they run smooth again, it climbs back up.

Every thread and every color you chose stays on screen. This logic comes from [Pardigon](https://quentinecrepont.com/work/pardigon), my film grain library. All the ribbons above run in auto quality.

## About the name

Dentelle is French for lace: fine threads that make a light, open pattern. In French, *c'est de la dentelle* also means delicate, precise work.

The project started as a twilight simulator: a physically based sky, with the sun just below the horizon. Then it became a ribbon of light. For the threads, I had Jolyne in mind, from JoJo's Bizarre Adventure. She can unravel her own body into string.

Its first name was Senja, dusk in Indonesian and Malay. npm turned it down as too close to existing packages, so the ribbon took the name of its threads.

The presets kept the skies of dusk: Blue Hour, Nacreous Cloud and Afterglow.

## What it shows

The ribbon I wanted on my own projects now goes behind any block, or a whole page, with one `createRibbon()` call.

- 3 presets named after the skies of dusk (Nov 2026).
- 42 options in its public API (Nov 2026).
- 17 KB gzipped, shaders included (Dec 2026).
- 0 dependencies at runtime (Nov 2026).

## Next steps

Dentelle is on [npm](https://www.npmjs.com/package/dentelle) and [GitHub](https://github.com/quentinecrepont/Dentelle), so anyone can install it in one command.

Next, Physical Sky: a live palette computed from the sun's position, with the same sky simulation as Afterglow.
