MediaWiki:Timeless.css:修订间差异
来自開源之海
无编辑摘要 |
无编辑摘要 标签:已被回退 |
||
| 第40行: | 第40行: | ||
} | } | ||
/* | /* 1. 移除之前可能干擾間距的 padding */ | ||
#p-toc-sidebar ul { | #p-toc-sidebar .sidebar-inner > ul { | ||
padding-bottom: 0 !important; | |||
margin | margin-bottom: 0; | ||
} | } | ||
#p-toc-sidebar .sidebar-inner { | /* 2. 僅針對目錄中「最後一個」大項目(1級標題)的底部進行拉伸 */ | ||
#p-toc-sidebar .sidebar-inner > ul > li:last-child { | |||
margin-bottom: 2.5em; /* 這裡精確控制最末尾的留白 */ | |||
} | } | ||
/* | /* 3. 確保 1 和 1.1 之間的間距緊湊 */ | ||
#p-toc-sidebar .toclevel-1 > ul { | |||
margin-top: 0.2em; /* 縮小大標題與其子標題之間的距離 */ | |||
margin-bottom: 0; | margin-bottom: 0; | ||
} | } | ||
#p-toc-sidebar .toclevel-1 { | |||
#p-toc-sidebar . | margin-top: 0.5em; /* 相鄰兩個 1級標題(如 1 和 2)之間的距離 */ | ||
margin-top: 0; | |||
} | } | ||
2026年4月29日 (三) 22:52的版本
/* 这里放置的CSS将应用于Timeless皮肤 */
/* 當螢幕寬度足夠時(寬於 1100px,避開 Timeless 的折疊狀態) */
/* 針對 Timeless 寬螢幕環境下的目錄優化 */
/* 當螢幕夠寬,Timeless 顯示右側欄時(通常為 1100px 以上) */
@media screen and (min-width: 1100px) {
/* 1. 移除正文區的目錄佔位 */
#toc {
position: absolute;
/* 將目錄推到右側預留的欄位空間 */
right: -17em;
top: 0;
/* 寬度與 Timeless 右欄對齊 */
width: 15.5em;
box-sizing: border-box;
/* 外觀與間距微調 */
margin: 0 !important;
padding: 1.2em;
background: #f8f9fa;
border: 1px solid #eaecf0;
font-size: 0.85em;
z-index: 1;
}
/* 2. 確保容器父元素是定位基準 */
#content {
position: relative;
}
}
/* 在中等或小螢幕下,讓目錄回到正文頂部正常顯示 */
@media screen and (max-width: 1099px) {
#toc {
position: static;
width: auto;
right: auto;
margin: 1em 0;
}
}
/* 1. 移除之前可能干擾間距的 padding */
#p-toc-sidebar .sidebar-inner > ul {
padding-bottom: 0 !important;
margin-bottom: 0;
}
/* 2. 僅針對目錄中「最後一個」大項目(1級標題)的底部進行拉伸 */
#p-toc-sidebar .sidebar-inner > ul > li:last-child {
margin-bottom: 2.5em; /* 這裡精確控制最末尾的留白 */
}
/* 3. 確保 1 和 1.1 之間的間距緊湊 */
#p-toc-sidebar .toclevel-1 > ul {
margin-top: 0.2em; /* 縮小大標題與其子標題之間的距離 */
margin-bottom: 0;
}
#p-toc-sidebar .toclevel-1 {
margin-top: 0.5em; /* 相鄰兩個 1級標題(如 1 和 2)之間的距離 */
}