“MediaWiki:Common.css”的版本间的差异
来自部落与弯刀Wiki
Skyswordkill(讨论 | 贡献) |
Skyswordkill(讨论 | 贡献) |
||
| 第89行: | 第89行: | ||
} | } | ||
| − | /* | + | /* 默认:PC端目录浮动在右侧 */ |
#toc { | #toc { | ||
position: fixed; | position: fixed; | ||
| 第104行: | 第104行: | ||
z-index: 999; | z-index: 999; | ||
font-size: 14px; | font-size: 14px; | ||
| − | |||
} | } | ||
| − | /* | + | /* 给正文加右边距,避免被 TOC 遮挡(仅PC端生效) */ |
| − | + | #bodyContent, .mw-parser-output { | |
| − | + | margin-right: 320px; | |
| − | |||
| − | |||
} | } | ||
| − | /* | + | /* 当前正在阅读的标题高亮 */ |
#toc a.active-section { | #toc a.active-section { | ||
font-weight: bold; | font-weight: bold; | ||
| 第120行: | 第117行: | ||
} | } | ||
| − | /* | + | /* 📱 手机端适配:目录取消浮动,正文不加边距 */ |
@media screen and (max-width: 768px) { | @media screen and (max-width: 768px) { | ||
#toc { | #toc { | ||
| − | + | position: static; | |
| + | width: auto; | ||
| + | max-height: none; | ||
| + | border-radius: 0; | ||
| + | box-shadow: none; | ||
| + | margin-bottom: 1em; | ||
| + | padding: 8px 10px; | ||
} | } | ||
| − | # | + | #bodyContent, .mw-parser-output { |
| − | + | margin-right: 0; | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
} | } | ||
} | } | ||
2025年6月10日 (二) 18:57的版本
/* 这里放置的CSS将应用于所有皮肤 */
/* 背景与整体字体优化 */
body {
background: #fdfdfd;
font-family: "Helvetica Neue", "Microsoft YaHei", sans-serif;
font-size: 15px;
color: #333;
}
/* 顶部条颜色统一 */
#mw-page-base, #mw-head-base, #mw-head, #mw-panel {
background-color: #722;
}
/* 页面标题样式 */
#firstHeading {
font-size: 26px;
font-weight: bold;
border-bottom: 2px solid #aaa;
padding-bottom: 10px;
margin-bottom: 20px;
}
/* 修改内容框边距与间距 */
#bodyContent {
line-height: 1.7;
padding: 20px;
}
/* 美化目录(TOC) */
.toc {
background-color: #f9f9f9;
border: 1px solid #ccc;
padding: 10px 15px;
border-radius: 6px;
font-size: 14px;
}
/* TOC标题粗体显示 */
.toc .toctitle {
font-weight: bold;
}
/* 表格样式美化 */
table.wikitable {
border-collapse: collapse;
border: 1px solid #ccc;
background: #fff;
}
table.wikitable th, table.wikitable td {
border: 1px solid #ccc;
padding: 8px 12px;
}
/* 链接颜色统一 */
a {
color: #005a9c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* 编辑按钮优化 */
.mw-editsection {
font-size: 12px;
margin-left: 10px;
}
.mw-editsection a {
color: #999;
}
.mw-editsection a:hover {
color: #000;
}
/* 页面底部信息栏隐藏(可选) */
#footer {
display: none;
}
/* 左侧导航栏字体与间距优化 */
#mw-panel {
font-size: 14px;
padding-top: 15px;
}
#mw-panel .portal {
margin-bottom: 20px;
}
/* 默认:PC端目录浮动在右侧 */
#toc {
position: fixed;
top: 100px;
right: 30px;
width: 260px;
max-height: 80vh;
overflow-y: auto;
background-color: #fdfdfd;
border: 1px solid #ccc;
padding: 12px 16px;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
z-index: 999;
font-size: 14px;
}
/* 给正文加右边距,避免被 TOC 遮挡(仅PC端生效) */
#bodyContent, .mw-parser-output {
margin-right: 320px;
}
/* 当前正在阅读的标题高亮 */
#toc a.active-section {
font-weight: bold;
color: #c00 !important;
}
/* 📱 手机端适配:目录取消浮动,正文不加边距 */
@media screen and (max-width: 768px) {
#toc {
position: static;
width: auto;
max-height: none;
border-radius: 0;
box-shadow: none;
margin-bottom: 1em;
padding: 8px 10px;
}
#bodyContent, .mw-parser-output {
margin-right: 0;
}
}