descriptions · neumorphic · 灵感来源:Neumorphism(同色浮起的面板)
两列:短字段并排
单列:长值不挤
Description List · 拟态描述列表 · 描述 / Neumorphic
做一个 Description List(拟态描述列表):
- 同一份 props(items / columns)
- 同色底 + 两条外投影,没有边框;面板浮起,内部键值不再加框
- 语义仍是 dl / dt / dd
用这些 CSS 变量:--color-text --color-text-muted --color-text-subtle --neuro-bg --neuro-dark --neuro-light --text-2xs
灵感参考:Neumorphism(同色浮起的面板)--color-text --color-text-muted --color-text-subtle --neuro-bg --neuro-dark --neuro-light --text-2xs
(无必缺状态)
(尚未接进整页场景)
/r/descriptions--neumorphic.json
免外壳的 markdown 版:/llms/components/descriptions--neumorphic.mddl / dt / dd,两列只在 sm 以上生效import { type ReactNode } from 'react';
interface Props {
items: { label: string; value: ReactNode }[];
columns?: 1 | 2;
className?: string;
}
export function NeumorphicDescriptions({ items, columns = 1, className = '' }: Props) {
return (
<dl
className={`
grid gap-x-6 gap-y-4 p-5 rounded-lg
bg-[var(--neuro-bg)] border border-transparent
shadow-[3px_3px_8px_var(--neuro-dark),-3px_-3px_8px_var(--neuro-light)]
${columns === 2 ? 'sm:grid-cols-2' : ''}
${className}
`}
>
{items.map((item) => (
<div key={item.label} className="min-w-0">
<dt className="text-[length:var(--text-2xs)] uppercase tracking-[0.16em] text-[var(--color-text-subtle)]">
{item.label}
</dt>
<dd className="mt-1 text-sm text-[var(--color-text)] break-words">{item.value}</dd>
</div>
))}
</dl>
);
}
src/components/descriptions/neumorphic/