Color Lab Sample Scan
A translucent color sheet moves across a material swatch to compare base and finish colors.
A translucent color sheet moves across a material swatch to compare base and finish colors.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<div class="tbx-1258"><button class="sample" type="button" aria-label="Show material finish colors"><span class="grain"></span><span class="tint"></span><span class="badge">MATERIAL 04</span><span class="caption">NATURAL <b>↗</b> FINISHED</span></button></div>
.tbx-1258{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;min-height:218px;overflow:visible;padding:24px 18px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#243e43}
.tbx-1258 *,.tbx-1258 *::before,.tbx-1258 *::after{box-sizing:border-box}
.tbx-1258{background:#f0ede8}
.tbx-1258 .sample{border:0;position:relative;overflow:hidden;width:min(290px,100%);height:171px;cursor:pointer;background:#c8b29a;padding:0;box-shadow:0 7px 22px #4c3a2f25}
.tbx-1258 .grain{position:absolute;inset:0;background:repeating-linear-gradient(25deg,#c5ab8d 0 3px,#e0c8a8 4px 13px,#9f856e 14px 15px);opacity:.85}
.tbx-1258 .grain:after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,#ffffff19 0 1px,transparent 2px 7px)}
.tbx-1258 .tint{position:absolute;inset:0;background:linear-gradient(145deg,#526d65ee,#243b3cdd);clip-path:inset(0 100% 0 0);transition:clip-path .65s cubic-bezier(.15,.7,.2,1)}
.tbx-1258 .badge{position:absolute;top:12px;left:13px;background:#f7f5e9;padding:6px 8px;font:750 9px/1.2 system-ui;letter-spacing:.12em;color:#4e514a}
.tbx-1258 .caption{position:absolute;bottom:13px;left:13px;color:white;font-size:10px;letter-spacing:.1em;text-shadow:0 2px 5px #0009}
.tbx-1258 .caption b{font-size:16px;font-weight:400;display:inline-block;transition:transform .4s}
.tbx-1258 .sample:is(:hover,:focus-visible) .tint{clip-path:inset(0)}
.tbx-1258 .sample:is(:hover,:focus-visible) .caption b{transform:translateX(8px)}
@media (prefers-reduced-motion: reduce) {.tbx-1258 *, .tbx-1258 *::before, .tbx-1258 *::after { transition-duration:0.01ms !important; animation-duration:0.01ms !important; scroll-behavior:auto !important; } }
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for product showcases and portfolio galleries.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.