MediaWiki:Common.css:修订间差异

来自神国反恶俗
跳到导航跳到搜索
无编辑摘要
toc-style
 
(未显示同一用户的24个中间版本)
第1行: 第1行:
/* 这里放置的CSS将应用于所有皮肤 */
/* 神国维基顶部工具栏 */
 
#sg-topbar.sg-sticky-bar {
/* ============================================================
    position: fixed;
  MediaWiki:Common.css  ——  神国维基全站样式
    top: 0;
  ============================================================ */
    left: 0;
 
    right: 0;
/* ------------------------------------------------------------
    z-index: 10000;
  ① 目录(TOC):去掉默认的浮动与边框,改成整块显示
     display: flex;
  ------------------------------------------------------------ */
     align-items: center;
.mw-table-of-contents-container,
     justify-content: space-between;
.mw-table-of-contents,
     gap: 1rem;
#toc,
     padding: 7px 16px;
.toc {
    background: #ffffff;
     float: none;
     border-bottom: 1px solid #a7d7f9;
     width: auto;
     box-shadow: 0 1px 5px rgba(0,0,0,.12);
     max-width: none;
     font-size: 14px;
     margin: 0;
    line-height: 1.5;
     padding: 0;
     border: none;
     background: none;
     font-size: 1em;
}
}
 
#sg-topbar .sg-bar-left,
#p-toc .pBody {
#sg-topbar .sg-bar-right {
     max-height: 70vh;
     display: flex;
     overflow-y: auto;
     align-items: center;
     font-size: 0.9em;
     gap: 12px;
     line-height: 1.6;
     flex-wrap: wrap;
}
}
 
#sg-topbar a {
#p-toc ul {
     color: #0645ad;
     margin: 0;
    text-decoration: none;
     padding-left: 1.6em;
     white-space: nowrap;
}
}
#sg-topbar a:hover { text-decoration: underline; }
body.sg-sticky-on { padding-top: 48px; }


#p-toc .toctitle,
/* 顶部工具栏高度变量,修复左栏/正文与顶栏之间的缝 */
#p-toc .mw-table-of-contents__heading,
:root { --sg-topbar-height: 37px; }
#p-toc .mw-table-of-contents-header {
body.sg-sticky-on { padding-top: var(--sg-topbar-height) !important; }
    display: none;
}


/* ------------------------------------------------------------
/* 左侧栏固定跟随 + 纵向滚动条 */
  ② 左侧导航栏:随屏幕滚动固定
#column-one {
  ------------------------------------------------------------ */
    position: fixed !important;
#column-one,
    top: var(--sg-topbar-height, 37px) !important;
.mw-portlet,
    bottom: 0 !important;
.vector-menu-portal,
    left: 0 !important;
.sidebar-inner {
    height: auto !important;
     position: -webkit-sticky;
    max-height: calc(100vh - var(--sg-topbar-height, 37px)) !important;
     position: sticky;
    overflow-y: scroll !important;
     top: 0;
    overflow-x: hidden !important;
     max-height: 100vh;
    z-index: 9000;
     overflow-y: auto;
     background: #ffffff;
     box-sizing: border-box;
     padding-bottom: 70px !important;
     scrollbar-width: thin;
     scrollbar-color: #a7d7f9 #f0f4f8;
}
}
#column-one::-webkit-scrollbar { width: 7px; }
#column-one::-webkit-scrollbar-track { background: #f0f4f8; }
#column-one::-webkit-scrollbar-thumb { background: #a7d7f9; border-radius: 4px; }
#column-one::-webkit-scrollbar-thumb:hover { background: #7cb8e8; }


/* ------------------------------------------------------------
/* 左下角页脚图片:固定在左栏上方,避免被固定侧栏盖住 */
  ③ 顶部两排栏固定
#f-copyrightico {
  ------------------------------------------------------------ */
 
/* 第一排(右上角):七叶 / 讨论 / 参数设置 / 监视列表 / 贡献 / 退出 */
#p-personal {
     position: fixed !important;
     position: fixed !important;
    top: 0 !important;
     left: 8px !important;
    right: 12px !important;
     bottom: 8px !important;
     left: auto !important;
     z-index: 9500 !important;
     margin: 0 !important;
     padding: 5px 12px !important;
     background: #ffffff;
     background: #ffffff;
     border-radius: 0 0 6px 6px;
     padding: 4px;
     box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
     border-radius: 4px;
     z-index: 301;
     line-height: 0;
}
}


/* 第二排(左侧):页面 / 讨论 / 编辑源代码 / 历史 / 删除 */
@media (max-width: 720px) {
#p-cactions {
    #column-one {
    position: fixed !important;
        position: static !important;
    top: 34px !important;
        top: auto !important;
    left: 50% !important;
        bottom: auto !important;
    margin-left: -505px !important;
        height: auto !important;
     padding: 4px 10px !important;
        max-height: none !important;
    background: #ffffff;
        overflow: visible !important;
    border-radius: 0 0 6px 6px;
        padding-bottom: 18px !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
     }
    z-index: 300;
    #f-copyrightico {
        position: static !important;
        left: auto !important;
        bottom: auto !important;
        padding: 0;
        background: transparent;
    }
}
}


/* 正文往下让出两排的高度 */
/* 页脚左侧图片恢复自然位置,与右侧 Powered by MediaWiki 对称 */
#content {
#f-copyrightico {
     padding-top: 34px;
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    float: left !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 8px !important;
     padding: 0 !important;
    background: transparent !important;
    z-index: auto !important;
    line-height: normal !important;
}
/* 页脚左侧图片避开固定左栏,向右对齐 */
#f-copyrightico {
    margin-left: calc(12.2em + 32px) !important;
    margin-right: 8px !important;
}
@media (max-width: 720px) {
    #f-copyrightico { margin-left: 8px !important; }
}
}
#p-cactions:empty,
/* 页脚左侧图片与右侧 MediaWiki 图标垂直对齐 */
#p-cactions:has(ul:empty) {
#f-copyrightico {
     display: none !important;
     top: 3px !important;
}
}
 
/* 目录由 Common.js 插入到导航与搜索之间,保持侧栏原有顺序 */
body:not(:has(#p-cactions li)) #content {
#column-one {
     padding-top: 0;
     display: block !important;
}
}


/* ------------------------------------------------------------
/* 目录常显:去掉 TOC 自带的“[隐藏]”开关 */
  ④ 标签栏美化:圆角 + 当前页橙色高亮
#p-toc #toc .toctitle {
  ------------------------------------------------------------ */
     display: none !important;
#p-cactions ul {
     margin: 0;
    padding: 0;
    list-style: none;
}
}
 
#p-toc #toc .toctogglecheckbox {
#p-cactions li {
     display: none !important;
     display: inline-block;
    margin: 0 2px 0 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #c8ccd1;
    border-radius: 6px 6px 0 0;
}
}
 
#p-toc #toc .toctogglecheckbox:checked ~ ul {
#p-cactions li:hover {
     display: block !important;
     background: #eaf3ff;
    border-color: #36c;
}
}


#p-cactions li.selected {
/* 让目录与左栏其它 portlet 的边框、缩进和字号一致 */
     background: #ffffff;
#p-toc #toc {
     border: 2px solid #f7941d;
     display: block !important;
     font-weight: bold;
    margin: 0 !important;
    padding: 0 0 4px 0 !important;
     border: 0 !important;
    background: transparent !important;
     font-size: 100% !important;
    line-height: 1.5 !important;
}
}
 
#p-toc #toc ul {
#p-cactions li a {
     margin: 0 !important;
     display: block;
     padding: 0 !important;
     padding: 5px 12px;
     list-style: none !important;
    color: #36c;
     text-decoration: none;
}
}
 
#p-toc #toc li {
#p-cactions li.selected a {
     margin: 0 !important;
     color: #b32424;
    padding: 0 !important;
    line-height: 1.5 !important;
}
}
 
#p-toc #toc .tocnumber {
#p-cactions li a:hover {
    color: #202122 !important;
     text-decoration: none;
     padding-right: 0.25em;
}
}
 
#p-toc #toc .toctext {
/* ------------------------------------------------------------
    color: #0645ad;
  ⑤ 窄屏(小于 900px)放开固定
  ------------------------------------------------------------ */
@media screen and (max-width: 900px) {
    #p-personal,
    #p-cactions {
        position: static !important;
        margin-left: 0 !important;
        box-shadow: none;
        border-radius: 0;
    }
 
    #content {
        padding-top: 0;
    }
}
}

2026年10月31日 (六) 01:31的最新版本

/* 神国维基顶部工具栏 */
#sg-topbar.sg-sticky-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 7px 16px;
    background: #ffffff;
    border-bottom: 1px solid #a7d7f9;
    box-shadow: 0 1px 5px rgba(0,0,0,.12);
    font-size: 14px;
    line-height: 1.5;
}
#sg-topbar .sg-bar-left,
#sg-topbar .sg-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
#sg-topbar a {
    color: #0645ad;
    text-decoration: none;
    white-space: nowrap;
}
#sg-topbar a:hover { text-decoration: underline; }
body.sg-sticky-on { padding-top: 48px; }

/* 顶部工具栏高度变量,修复左栏/正文与顶栏之间的缝 */
:root { --sg-topbar-height: 37px; }
body.sg-sticky-on { padding-top: var(--sg-topbar-height) !important; }

/* 左侧栏固定跟随 + 纵向滚动条 */
#column-one {
    position: fixed !important;
    top: var(--sg-topbar-height, 37px) !important;
    bottom: 0 !important;
    left: 0 !important;
    height: auto !important;
    max-height: calc(100vh - var(--sg-topbar-height, 37px)) !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    z-index: 9000;
    background: #ffffff;
    box-sizing: border-box;
    padding-bottom: 70px !important;
    scrollbar-width: thin;
    scrollbar-color: #a7d7f9 #f0f4f8;
}
#column-one::-webkit-scrollbar { width: 7px; }
#column-one::-webkit-scrollbar-track { background: #f0f4f8; }
#column-one::-webkit-scrollbar-thumb { background: #a7d7f9; border-radius: 4px; }
#column-one::-webkit-scrollbar-thumb:hover { background: #7cb8e8; }

/* 左下角页脚图片:固定在左栏上方,避免被固定侧栏盖住 */
#f-copyrightico {
    position: fixed !important;
    left: 8px !important;
    bottom: 8px !important;
    z-index: 9500 !important;
    background: #ffffff;
    padding: 4px;
    border-radius: 4px;
    line-height: 0;
}

@media (max-width: 720px) {
    #column-one {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding-bottom: 18px !important;
    }
    #f-copyrightico {
        position: static !important;
        left: auto !important;
        bottom: auto !important;
        padding: 0;
        background: transparent;
    }
}

/* 页脚左侧图片恢复自然位置,与右侧 Powered by MediaWiki 对称 */
#f-copyrightico {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    float: left !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 8px !important;
    padding: 0 !important;
    background: transparent !important;
    z-index: auto !important;
    line-height: normal !important;
}
/* 页脚左侧图片避开固定左栏,向右对齐 */
#f-copyrightico {
    margin-left: calc(12.2em + 32px) !important;
    margin-right: 8px !important;
}
@media (max-width: 720px) {
    #f-copyrightico { margin-left: 8px !important; }
}
/* 页脚左侧图片与右侧 MediaWiki 图标垂直对齐 */
#f-copyrightico {
    top: 3px !important;
}
/* 目录由 Common.js 插入到导航与搜索之间,保持侧栏原有顺序 */
#column-one {
    display: block !important;
}

/* 目录常显:去掉 TOC 自带的“[隐藏]”开关 */
#p-toc #toc .toctitle {
    display: none !important;
}
#p-toc #toc .toctogglecheckbox {
    display: none !important;
}
#p-toc #toc .toctogglecheckbox:checked ~ ul {
    display: block !important;
}

/* 让目录与左栏其它 portlet 的边框、缩进和字号一致 */
#p-toc #toc {
    display: block !important;
    margin: 0 !important;
    padding: 0 0 4px 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 100% !important;
    line-height: 1.5 !important;
}
#p-toc #toc ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
#p-toc #toc li {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}
#p-toc #toc .tocnumber {
    color: #202122 !important;
    padding-right: 0.25em;
}
#p-toc #toc .toctext {
    color: #0645ad;
}