fix: make PageContainer header fixed below CustomHeader with reduced height
This commit is contained in:
parent
79a2409ad9
commit
238166ca44
@ -75,36 +75,45 @@ body {
|
||||
left: 64px !important;
|
||||
}
|
||||
|
||||
// Tabs Header样式 - 使用padding-top避免重叠
|
||||
// PageContainer Header样式 - 固定悬浮在CustomHeader下方
|
||||
div[class*="page-container-header"],
|
||||
.ant-pro-page-container > div[class*="page-container-header"],
|
||||
.ant-pro-page-container-header {
|
||||
padding-top: 64px !important; /* 等于CustomHeader的高度 */
|
||||
padding-bottom: 0 !important;
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
position: fixed !important;
|
||||
top: 64px !important; /* CustomHeader的高度 */
|
||||
right: 0 !important;
|
||||
left: 220px !important; /* 侧边栏宽度 */
|
||||
z-index: 1000 !important; /* 低于CustomHeader */
|
||||
margin: 0 !important;
|
||||
padding: 6px 24px !important; /* 减小padding */
|
||||
background: #ffffff !important;
|
||||
border-bottom: 1px solid #f0f0f0 !important;
|
||||
position: relative !important;
|
||||
box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
|
||||
height: auto !important;
|
||||
min-height: 36px !important; /* 减小最小高度 */
|
||||
max-height: 48px !important; /* 减小最大高度 */
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
// Tabs header的内部padding
|
||||
.ant-pro-page-container-header > div,
|
||||
div[class*="page-container-header"] > div {
|
||||
padding: 6px 24px !important; /* 内部padding */
|
||||
// 当侧边栏折叠时,调整tabs header的left值
|
||||
.ant-layout-sider-collapsed ~ .ant-layout .ant-pro-page-container-header {
|
||||
left: 64px !important;
|
||||
}
|
||||
|
||||
// 强制PageContainer header样式
|
||||
.ant-pro-page-container .ant-pro-page-container-header {
|
||||
padding-top: 64px !important;
|
||||
padding-bottom: 0 !important;
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
position: fixed !important;
|
||||
top: 64px !important;
|
||||
right: 0 !important;
|
||||
left: 220px !important;
|
||||
z-index: 1000 !important;
|
||||
margin: 0 !important;
|
||||
background: #ffffff !important;
|
||||
border-bottom: 1px solid #f0f0f0 !important;
|
||||
padding: 6px 24px !important;
|
||||
min-height: 36px !important;
|
||||
max-height: 48px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
// Tabs样式优化 - 减小高度
|
||||
@ -113,6 +122,8 @@ div[class*="page-container-header"] .tabs-header-only {
|
||||
margin: 0 !important;
|
||||
line-height: 1 !important;
|
||||
height: auto !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.ant-pro-page-container-header .ant-tabs,
|
||||
@ -131,6 +142,8 @@ div[class*="page-container-header"] .ant-tabs-nav {
|
||||
div[class*="page-container-header"] .ant-tabs-nav-list {
|
||||
margin-bottom: 0 !important;
|
||||
height: auto !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.ant-pro-page-container-header .ant-tabs-tab,
|
||||
@ -140,8 +153,8 @@ div[class*="page-container-header"] .ant-tabs-tab {
|
||||
border-radius: 4px;
|
||||
margin-right: 4px;
|
||||
transition: all 0.2s;
|
||||
height: 28px !important; /* 减小标签高度 */
|
||||
line-height: 28px !important;
|
||||
height: 26px !important; /* 进一步减小标签高度 */
|
||||
line-height: 26px !important;
|
||||
font-size: 13px;
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
@ -158,7 +171,12 @@ div[class*="page-container-header"] .ant-tabs-ink-bar {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
// 移除PageContainer原有的间距
|
||||
// 内容区域 - 调整padding以适应固定的header
|
||||
.ant-pro-grid-content {
|
||||
padding: 24px;
|
||||
padding-top: 120px; /* 64px CustomHeader + 48px tabs header + 8px */
|
||||
}
|
||||
|
||||
.ant-pro-page-container {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
@ -167,6 +185,11 @@ div[class*="page-container-header"] .ant-tabs-ink-bar {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.ant-pro-page-container-children-content {
|
||||
padding-top: 0 !important;
|
||||
padding: 24px !important;
|
||||
}
|
||||
|
||||
.custom-header .header-left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user