Principles field
A canvas of drifting hairlines over four principle captions.
Part of the style
Graphite Split Index
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/graphite-split-index/principles/figma.html?palette=43349c538817c61e
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/graphite-split-index/principles/figma.html?palette=43349c538817c61e and pass that whole HTML document to the html_to_figma tool, so the part "Principles field" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
:root {
--ink: #1d0c0a;
--paper: #ffffff;
--ink-mute: #79766e;
--chip: #f0efee;
--stage: #b0aea8;
--panel: #433231;
--panel-raised: #231614;
--panel-line: #584947;
--on-panel: #f2f2f1;
--on-panel-soft: #d8d7d4;
--on-panel-mute: #6b5f5d;
--glass: rgba(128, 116, 114, 0.55);
--signal: #bb635f;
}
</style>
<section class="principles">
<div class="principles__card">
<p class="principles__tag"><span class="principles__pixel" aria-hidden="true"></span><span class="principles__num">3</span>Principles</p>
<div class="principles__field">
<canvas class="principles__canvas" role="img" aria-label="Stacked hairlines whose gaps drift slowly sideways"></canvas>
</div>
<ul class="principles__list">
<li class="principles__item"><span class="principles__name">Tried first</span><span class="principles__text">Nothing is drawn clean until it has been made badly at full size.</span></li>
<li class="principles__item"><span class="principles__name">Fewer parts</span><span class="principles__text">Every screw we can remove is a repair someone never needs.</span></li>
<li class="principles__item"><span class="principles__name">Kept, not used up</span><span class="principles__text">We design for the tenth year, not the first week.</span></li>
<li class="principles__item"><span class="principles__name">Quiet names</span><span class="principles__text">A mark should sit on the object like a maker's stamp.</span></li>
</ul>
</div>
</section>
<style>
.principles {
padding: var(--band);
background: var(--paper);
}
.principles__card {
display: grid;
gap: var(--space-l);
padding: var(--space-s) var(--edge) var(--space-l);
border-radius: var(--radius);
background: var(--panel);
color: var(--on-panel);
}
.principles__tag {
display: flex;
align-items: center;
gap: var(--space-xs);
margin: 0;
font-size: var(--text-s);
}
.principles__pixel {
position: relative;
width: 20px;
height: 20px;
border-radius: var(--radius-s);
background: var(--on-panel);
}
.principles__pixel::after {
content: "";
position: absolute;
inset: 5px;
background:
linear-gradient(var(--panel), var(--panel)) 0 0 / 4px 4px no-repeat,
linear-gradient(var(--panel), var(--panel)) 100% 0 / 4px 4px no-repeat,
linear-gradient(var(--panel), var(--panel)) 50% 50% / 4px 4px no-repeat,
linear-gradient(var(--panel), var(--panel)) 0 100% / 4px 4px no-repeat,
linear-gradient(var(--panel), var(--panel)) 100% 100% / 4px 4px no-repeat;
}
.principles__num {
display: grid;
place-items: center;
width: 20px;
height: 20px;
margin-right: var(--space-s);
border-radius: var(--radius-pill);
background: var(--on-panel-mute);
color: var(--on-panel-soft);
}
.principles__field { height: clamp(220px, 28vw, 400px); }
.principles__canvas { width: 100%; height: 100%; color: var(--on-panel-soft); }
.principles__list {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: var(--space-m) var(--gap);
margin: 0;
padding: 0;
list-style: none;
font-size: var(--text-s);
line-height: 1.17;
}
.principles__item { display: grid; align-content: start; }
.principles__text { max-width: 28ch; color: var(--ink-mute); }
@media (max-width: 760px) {
.principles__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
</style>
<script>
(() => {
const still = matchMedia('(prefers-reduced-motion: reduce)');
const STEP = 9;
function paint(context, width, height, seconds) {
context.clearRect(0, 0, width, height);
context.strokeStyle = getComputedStyle(context.canvas).color;
context.lineWidth = 1;
const split = Math.round(width * 0.72);
const rows = Math.floor(height / STEP);
context.beginPath();
for (let row = 0; row < rows; row += 1) {
const y = Math.round(row * STEP) + 0.5;
const centre = split * (0.5 + 0.32 * Math.sin(row * 0.16 + seconds * 0.35));
const hole = split * Math.max(0, 0.1 + 0.09 * Math.sin(row * 0.27 - seconds * 0.25));
const left = centre - hole / 2;
const right = centre + hole / 2;
context.moveTo(0, y); context.lineTo(Math.max(0, left), y);
context.moveTo(Math.min(split - 12, right), y); context.lineTo(split - 12, y);
if (hole > split * 0.08) {
const bit = hole * 0.35;
context.moveTo(centre - bit / 2, y); context.lineTo(centre + bit / 2, y);
}
const side = width - split;
const cut = split + side * (0.5 + 0.4 * Math.sin(row * 0.11 - seconds * 0.2));
context.moveTo(split, y); context.lineTo(cut - 6, y);
context.moveTo(cut + 6 + (row % 3) * 10, y); context.lineTo(width, y);
}
context.stroke();
}
function run(canvas) {
const context = canvas.getContext('2d');
let frame = 0;
const fit = () => {
const density = Math.min(2, devicePixelRatio || 1);
canvas.width = canvas.clientWidth * density;
canvas.height = canvas.clientHeight * density;
context.setTransform(density, 0, 0, density, 0, 0);
paint(context, canvas.clientWidth, canvas.clientHeight, performance.now() / 1000);
};
const tick = (now) => {
paint(context, canvas.clientWidth, canvas.clientHeight, now / 1000);
frame = requestAnimationFrame(tick);
};
new ResizeObserver(fit).observe(canvas);
new IntersectionObserver(([entry]) => {
cancelAnimationFrame(frame);
if (entry.isIntersecting && !still.matches) frame = requestAnimationFrame(tick);
}).observe(canvas);
}
document.querySelectorAll('.principles__canvas').forEach(run);
})();
</script>