fix(breadcrumb): 修复移动端面包屑偏移问题
根本原因:负边距(-ml-1/-mr-1)和不对称样式导致视觉偏移 修复内容: - 移除所有负边距 - 统一图标大小为 w-4 h-4 (16px) - 使用一致的间距系统 gap-1.5 - 对称的点击区域 p-1.5 rounded
This commit is contained in:
@@ -14,20 +14,20 @@ interface BreadcrumbProps {
|
||||
|
||||
export function Breadcrumb({ items }: BreadcrumbProps) {
|
||||
return (
|
||||
<nav aria-label="breadcrumb" className="flex items-center gap-1 md:gap-2 text-xs md:text-sm text-[#5C5C5C] py-3 md:py-4 overflow-x-auto">
|
||||
<nav aria-label="breadcrumb" className="flex items-center gap-1.5 text-xs md:text-sm text-[#5C5C5C] py-3 md:py-4">
|
||||
<StaticLink
|
||||
href="/"
|
||||
className="flex items-center hover:text-[#C41E3A] transition-colors shrink-0 p-1 -ml-1 md:ml-0"
|
||||
className="inline-flex items-center hover:text-[#C41E3A] transition-colors p-1.5 rounded"
|
||||
aria-label="返回首页"
|
||||
>
|
||||
<Home className="w-3.5 h-3.5 md:w-4 md:h-4" />
|
||||
<Home className="w-4 h-4" />
|
||||
</StaticLink>
|
||||
{items.map((item, index) => (
|
||||
<div key={index} className="flex items-center shrink-0">
|
||||
<ChevronRight className="w-3 h-3 md:w-4 md:h-4 text-[#E5E5E5]" />
|
||||
<div key={index} className="flex items-center">
|
||||
<ChevronRight className="w-4 h-4 text-[#E5E5E5] mx-0.5" />
|
||||
<StaticLink
|
||||
href={item.href}
|
||||
className="ml-1 md:ml-2 hover:text-[#C41E3A] transition-colors p-1 -mr-1 md:mr-0"
|
||||
className="hover:text-[#C41E3A] transition-colors px-1.5 py-1 rounded"
|
||||
>
|
||||
{item.label}
|
||||
</StaticLink>
|
||||
|
||||
Reference in New Issue
Block a user