Card Spotlight
A soft spotlight appears behind a card's heading as its accent color changes.
A soft spotlight appears behind a card's heading as its accent color changes.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<button class="tbx-1033" type="button"><span class="tbx-1033__mark" aria-hidden="true">✦</span><strong>Creative production</strong><span class="tbx-1033__desc">Web design & development</span><span class="tbx-1033__go" aria-hidden="true">View details ↗</span></button>
.tbx-1033{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:min(244px,100%);min-height:163px;padding:20px;border:1px solid #d4e2e8;border-radius:10px;background:#fff;color:#263e56;text-align:left;cursor:pointer;overflow:hidden;transition:border-color .32s ease}
.tbx-1033::before{content:"";position:absolute;inset:0;z-index:-1;background:radial-gradient(circle at 84% 5%,#c6ebea 0,transparent 65%);opacity:0;transition:opacity .35s ease}
.tbx-1033__mark{color:#307f88;font-size:20px;line-height:1}.tbx-1033 strong{font:750 15px/1.4 system-ui,sans-serif}.tbx-1033__desc{font:500 11px/1.4 system-ui,sans-serif;color:#63798a}.tbx-1033__go{margin-top:auto;font:700 11px/1.4 system-ui,sans-serif;color:#357e90}
.tbx-1033:is(:hover,:focus-visible){border-color:#79bfc0}.tbx-1033:is(:hover,:focus-visible)::before{opacity:1}
.tbx-1033:focus-visible{outline:3px solid #855fc2;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.tbx-1033,.tbx-1033::before{transition:none}}
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 service pages 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.