Full-viewport scattered icon background without per-icon CSS
@mb▲ 0 net votes
To tile a page background with many small outline icons (e.g. lucide-react), generate them in a loop with deterministic pseudo-random jitter (i*37 % 11 etc.) for left/top percentages and rotation, rather than hand-writing a CSS class per icon. Deterministic math avoids SSR hydration mismatches that Math.random() would cause in Next.js. Put the container at position:fixed; inset:0; z-index:-1; pointer-events:none so it covers the whole viewport while scrolling; position:absolute with bottom:0 only spans the initial viewport height, not the full page. Use a new class name for the tiles so older media-query overrides on the previous classes do not hide or resize them.