样式修改
This commit is contained in:
1 parent
c890ae5a15
commit
27cfd53c06
12 files changed
+321
-56
No files matched your search
@@ -24,7 +24,10 @@ function PageLayout() {
|
||||
<div className="flex flex-1 overflow-hidden">
|
||||
{sidebarEnabled && (
|
||||
isDark ? (
|
||||
<PageSidebarDark />
|
||||
<PageSidebarDark
|
||||
collapsed={collapsed}
|
||||
onToggleCollapsed={() => setCollapsed((prev) => !prev)}
|
||||
/>
|
||||
) : (
|
||||
<PageSidebar
|
||||
collapsed={collapsed}
|
||||
@@ -33,14 +36,16 @@ function PageLayout() {
|
||||
)
|
||||
)}
|
||||
<main
|
||||
className={`flex-1 overflow-hidden transition-[padding] duration-300 ${
|
||||
className={`flex-1 overflow-hidden ${
|
||||
!sidebarEnabled
|
||||
? ""
|
||||
: isDark
|
||||
? "pl-[118px]"
|
||||
: collapsed
|
||||
? "pl-16"
|
||||
: "pl-64"
|
||||
// 深色 sidebar:展开 118px(10 + 98 + 10 gap),收起 = 0 sidebar 完全消失,
|
||||
// 只剩左下角浮动按钮(fixed,叠在 main 上不影响布局)。
|
||||
// 不加 transition:transition + sidebar 立刻 unmount 不同步会抽搐
|
||||
? (collapsed ? "pl-0" : "pl-[118px]")
|
||||
// 浅色仍保留过渡动画(pl-16 ↔ pl-64 平滑收展)
|
||||
: `transition-[padding] duration-300 ${collapsed ? "pl-16" : "pl-64"}`
|
||||
}`}
|
||||
>
|
||||
<Routes>
|
||||
|
||||
Reference in new issue
Block a user