Dither Fade
A copy-paste noise & grain component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Noise & GrainHTMLCSSany framework
Copy into your project
HTML
<!-- Dither Fade — dithered gradient transition -->
<div class="nuda-grain-dither" aria-hidden="true">
<div class="nuda-grain-dither__mask"></div>
</div>CSS
.nuda-grain-dither {
position: relative;
width: 100%;
max-width: 220px;
height: 130px;
border-radius: 12px;
overflow: hidden;
background: linear-gradient(135deg,#e4ff54,#09090b);
isolation: isolate;
}
.nuda-grain-dither__mask {
position: absolute;
inset: 0;
background-color: #09090b;
background-image: radial-gradient(circle,#09090b 38%,transparent 42%),radial-gradient(circle,#09090b 38%,transparent 42%);
background-size: 6px 6px,6px 6px;
background-position: 0 0,3px 3px;
-webkit-mask-image: linear-gradient(90deg,#000,transparent);
mask-image: linear-gradient(90deg,#000,transparent);
-webkit-mask-size: 200% 100%;
mask-size: 200% 100%;
animation: _ditherSweep 6s ease-in-out infinite alternate;
}
@keyframes _ditherSweep {
0% {
-webkit-mask-position: 0% 0;
mask-position: 0% 0;
}
100% {
-webkit-mask-position: 100% 0;
mask-position: 100% 0;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-grain-dither__mask {
animation: none;
-webkit-mask-position: 50% 0;
mask-position: 50% 0;
}
}
How to use Dither Fade
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.