Luca Perullo
Components

Component

LiveNew

Line Shadow Text

data-text + ::before con attr(data-text), background-image repeating-linear-gradient(-45deg) clip-path text. Zero JS.

TextShadowCSS
Open in ClaudeSorgente

Esempio01

line-shadow-text.tsx
001Default · h1

Editorial

002Hero · paired display
Issue · 001

Catalogo

L'ombra è una trama di striscioline diagonali, non un blur. Vive sotto al titolo come una stampa offset.

003Subtle · accent shadow

2025

Note Lo shadow è translate(2px, 4px) e usa background-clip: text + WebkitTextFillColor transparent per vedere solo la trama tra le lettere.

Prompt LLM02

Incolla in Claude o ChatGPT per generare la tua variante. Include il contesto del brand, i token e i vincoli del progetto.

Prompt · line-shadow-text
Open in Claude
Sei un senior frontend engineer. Stai lavorando su un sito Next.js 16 + React 19 + Tailwind v4 in italiano, look chanhdai-inspired: colonna stretta 672px, Geist Sans + Geist Mono, hairline 1px, divisori a stripe diagonale, palette zinc.

Token CSS disponibili: --bg, --bg-alt, --fg, --fg-muted, --fg-soft, --border, --border-strong, --accent. Usa SEMPRE queste variabili tramite le utility tailwind generate (bg-bg, text-fg-muted, border-border, ecc.). Helper "cn" da "@/lib/utils". Niente librerie UI extra: solo lucide-react e tailwind-merge.

Genera un componente <LineShadowText> headline con ombra a strisce diagonali.
Props:
- children: string.
- as?: "h1"|"h2"|"h3"|"span" (default "h1").
- shadowColor?: string (default "var(--fg-muted)").
- className?: string.

Implementazione:
- Server component. Tag con data-text={children}, classe line-shadow-text + className utente.
- <style> inline: .line-shadow-text { position: relative; isolation: isolate; }, ::before { content: attr(data-text); inset: 0; transform: translate(2px, 4px); background-image: repeating-linear-gradient(-45deg, var(--lst-shadow) 0 1px, transparent 1px 4px); background-clip: text; color: transparent; z-index: -1; }
- CSS var --lst-shadow impostata via inline style.

Output: file completo src/components/line-shadow-text.tsx.

Uso tipico03

tsx
<LineShadowText shadowColor="var(--fg-muted)">Hello</LineShadowText>

Dipendenze04

npm
  • tailwind-merge
  • clsx
Interno
  • @/lib/utils#cn

Ti è servito? Dimmelo, oppure proponi il prossimo componente.