Using the lamp login in a shadcn app: scope its CSS first
lamp-login.css is written for the login page running on its own. It isn't in a CSS layer and it isn't scoped: html and body get the near-black background and Space Grotesk, every button and input is reset, --muted, --card and --font-mono land on :root, and short class names like .card, .panel, .main and .dark apply anywhere in your app.
We measured it on October 25, 2026 in a shadcn test page on Tailwind 4.3.3. Imported as shipped, the body turned near-black, every shadcn Card went dark and see-through (--card became rgba(17,18,24,.86)), bg-muted turned grey-blue, and Buttons and Inputs went from 14px to 16px. Dark mode is worse. shadcn puts the class dark on html, so the piece's .dark rule makes html position: absolute with pointer-events: none, and a click on a shadcn Button hit nothing.
The fix lives in your copy. The card's own outer div has the class root, which is too generic to scope on, so wrap it in a div with the class qd-lamp. Then make three edits to lamp-login.css and add three rules to globals.css. @scope keeps every piece rule inside .qd-lamp. The three rules roll Tailwind's preflight and shadcn's base layer back inside the card only, because the piece was built with preflight off.
With that in place, every shadcn element we measured matched a page without the card, at 1440 and 390 px, in light and dark mode. Inside the card, 166 elements matched the preflight-off build except 56 SVG parts that get a solid border style at zero width, which draws nothing. The phone layout still switches on under 760 px. We rendered the component's first frame from its shipped source in headless Chromium. We didn't run the sign-in animation, a full Next.js app, Safari or Firefox.
@scope works in Chrome and Edge 118+, Firefox 146+ and Safari 17.4+, per caniuse and MDN's compatibility data read October 25, 2026. MDN notes that Safari 26.0 to 26.3 doesn't apply @scope rules to input fields, so the email and password boxes would lose their styling there; 26.4 fixed it. A browser without @scope drops the whole block and the card shows up unstyled.
If you need those browsers, skip @scope. Delete the html:not(.fit) prefixes, turn :root, html and body into .qd-lamp, and put .qd-lamp in front of every other selector (* becomes .qd-lamp *). Leave the @keyframes block alone and keep the three globals.css rules. That version measured the same as the @scope one in Chromium, but we didn't open it in the older browsers it's meant for.
components/lamp-login.css (the edits)
/* components/lamp-login.css (your copy from the zip). Three edits: */
/* 1. Find "html:not(.fit) " and replace it with nothing.
It's on 7 lines inside the max-width: 760px block. */
/* 2. Change ":root{" to ":scope{" and "html,body{" to ":scope{". */
/* 3. Wrap the whole file in one @scope block: */
@scope (.qd-lamp) {
/* ...the file as shipped, with edits 1 and 2... */
}
/* @keyframes shake still works inside the block, but its name stays global.
If your app already has a "shake" animation, rename one of them. */
app/globals.css (the added rules)
/* Add below shadcn's theme and @layer base in app/globals.css */
/* Spotlight Lamp Login was built with Tailwind's preflight off. Inside .qd-lamp only,
roll the base styles (preflight and shadcn's base layer) back to browser
defaults. Unlayered and zero specificity, so the piece's own rules still win.
SVGs are left out: a revert would wipe their width, fill and stroke. */
:where(.qd-lamp, .qd-lamp :not(svg, svg *)) {
all: revert;
}
:where(.qd-lamp) {
line-height: normal;
}
:where(.qd-lamp svg) {
display: inline;
vertical-align: baseline;
}
Yes, as a client component. Keep "use client" at the top of the file that renders it, as in the snippet above. App Router and Pages Router both work.
Does it handle authentication?
It's the interface. Your onSignIn talks to Supabase, Clerk, NextAuth or your own API.
Will it change my shadcn styles?
As shipped, yes. It sets the body colours plus --muted and --card on :root, and its .dark rule breaks shadcn's dark mode. Wrap it in a qd-lamp div and make the edits on this page, and our shadcn test page measured the same as without it.
Can Cursor or v0 add it for me?
Yes. Each download has a PROMPT.md. Paste it into Cursor, Lovable, v0 or Claude Code and it fits the piece into your app.
Can I use it in client work?
Yes, in personal and client projects. You can't resell the code itself as a kit.