MediaWiki:Common.css

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/* 这里放置的CSS将应用于所有皮肤 */
/* Global definitions */
:root {
    --site-background: #000000 url(https://i.17173cdn.com/g8bz6k/backpackbattles/9/9a/Site-background.webp) fixed no-repeat center center/cover;
    
	--theme-text-color: #2f1c13;
	--theme-link-color: #046df6;
	--theme-link-color--visited: #027797;
    
    --outer-text-color: #fff;
    --outer-link-color: #64A6FC;
    --outer-link-color--visited: #02AFDE;
    --outer-link-color--redlink: #FF5252;
    --footer-text-color: #E2B99C;
    
	--theme-background: #fff;
	--theme-box-border-color: #2f1c13;
	--theme-box-background: #f6ebe3;
	--theme-accent-color: #5d3f1c;
    
    --template-color: 32 39%;
    --template-subcolor: 45 39%;
    --template-text: hsl(var(--template-color) var(--lightness-text, 70%));
    --template-primary: hsl(var(--template-color) var(--lightness-primary, 70%));
    --template-secondary: hsl(var(--template-color) var(--lightness-secondary, 85%));
    --template-tertiary: hsl(var(--template-color) var(--lightness-tertiary, 90%));
    --template-shadow: hsl(var(--template-color) var(--lightness-shadow, 40%));
    --template-sub-primary: hsl(var(--template-subcolor,var(--template-color,0 0%)) var(--lightness-primary, 70%));
    --template-sub-secondary: hsl(var(--template-subcolor,var(--template-color,0 0%)) var(--lightness-secondary, 85%));
    --template-sub-tertiary: hsl(var(--template-subcolor,var(--template-color,0 0%)) var(--lightness-tertiary, 90%));
    --lightness-text: 20%;
    --lightness-primary: 70%;
    --lightness-secondary: 85%;
    --lightness-tertiary: 90%;
    --lightness-shadow: 40%;
    
    --header-icon-color: #fff;
}

/* General */
body {
    background: var(--site-background);
}


#content {
    color: var(--theme-text-color);
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
}


a,
.vector-menu-portal .vector-menu-content li a,
.vector-menu-tabs-legacy li a,
.mw-parser-output a.extiw,
.mw-parser-output a.external {
	color: var(--theme-link-color);
}

a:visited,
.vector-menu-portal .vector-menu-content li a:visited,
.vector-menu-tabs-legacy li a:visited,
.mw-parser-output a.extiw:visited,
.mw-parser-output a.external:visited {
	color: var(--theme-link-color--visited);
}

.vector-menu-tabs-legacy .selected a,
.vector-menu-tabs-legacy .selected a:visited {
    color: var(--outer-text-color);
}

.mw-footer li {
    color: var(--footer-text-color);
}

.vector-menu-tabs-legacy li a,
.vector-menu-dropdown .vector-menu-heading,
#footer a {
    color: var(--outer-link-color);
}

.vector-menu-tabs-legacy li a:visited {
    color: var(--outer-link-color--visited);
}

.vector-menu-tabs-legacy .new a,
.vector-menu-tabs-legacy .new a:visited {
    color: var(--outer-link-color--redlink);
}

.nostyle-list ul,
ul.nostyle-list {
	list-style: none;
	margin: 0;
}


/* Top navigation */
#mw-page-base {
    height: 0;
}

#mw-head-base {
    height: 35px;
    margin: 0;
}

#mw-navigation,
#mw-head {
    height: 45px;
}

#mw-head {
    position: relative;
    display: grid;
    align-items: center;
    grid-template-columns: auto auto;
}

#mw-head .mw-list-item {
    background: none;
}

#left-navigation,
#right-navigation {
    margin-top: 0;
    margin-bottom: 0;
}

#ca-view {
    display: none;
}

.vector-menu-tabs {
    background: none;
    height: unset;
}

#p-namespaces li {
    margin-right: 1em;
}

#p-views li, #p-cactions {
    margin-left: 1em;
}

#mw-head li {
    padding-top: 4px;
    border-bottom: 4px solid transparent;
}

#mw-head #p-cactions-label {
    padding-top: 4px;
}

#mw-head li.selected, #mw-head li.selected:hover {
    border-bottom-color: var(--template-primary);
}

#mw-head li:hover {
    border-bottom-color: var(--template-shadow);
}

#mw-head li a {
    text-decoration: none;
}

#mw-navigation li.mw-list-item a, #mw-head #p-cactions-label {
    border: none;
    height: unset;
    padding: 0;
    background:  none;
}

#right-navigation {
    justify-self: end;
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
}
.vector-search-box form {
    margin: 0;
}
.vector-menu-tabs .mw-watchlink.icon a {
    text-indent: -99999px;
    padding: 0;
    width: 16px;
    height: 18px;
}
.vector-menu-tabs .mw-watchlink.icon a::before {
    top: 0;
    left: 0;
}
.vector-menu-dropdown .vector-menu-content {
    left: unset;
    right: 0;
}

@media only screen and (max-width: 961px) {
    .content-wrapper {
        flex-direction: column;
    }
    #mw-navigation {
        height: 78px;
        padding: 0 0.5em;
        display: grid;
        grid-template: 44px 34px auto / 0px 44px 1fr;
    }
    #mw-navigation > #mw-panel {
        width: unset;
        position: relative;
        display: grid;
    }
    
    #p-logo {
        width: unset;
        height: unset;
        margin: 6px 0 40px 0;
        pointer-events: none;
    }
    #p-logo > a {
        width: 32px;
        height: 32px;
        padding: 0 6px;
        background-size: contain;
        pointer-events: auto;
    }
    
    #mw-navigation > h2 {
        text-indent: -99999px;
        grid-area: 2 / 2;
        position: unset;
        width: 30px;
        height: 24px;
        padding: 0;
        margin: 0 auto;
        background: white url(https://backpackbattles.wiki.gg/images/3/3a/Site-icon-nav.svg) no-repeat center;
        background-size: 12px;
        cursor: pointer;
    }
    
    #left-navigation {
        margin-left: 0;
    }
    
    /* This combination of rules is required for the correct hover behavior. */
    #mw-navigation > h2:hover ~ #mw-panel > div:not(#p-logo),
    #mw-panel:hover > div:not(#p-logo) {
        display: block;
    }
    #mw-panel > #p-logo:hover ~ div {
        display: none;
    }
    #mw-panel > div:not(#p-logo) {
        display: none;
        z-index: 9999;
        width: 100%;
        margin: -10px 0 0 6px;
        white-space: nowrap;
    }
    
    #mw-head {
        grid-area: 1 / 3 / 3;
        position: relative;
        top: 0;
        height: 78px;
        box-sizing: border-box;
        padding: 8px 0px 8px 1em;
        grid-template-rows: 1fr 1fr;
    }
    #left-navigation,
    #right-navigation {
        grid-row: 2;
    }
    #p-search {
        position: absolute;
        right: 0;
        top: 0;
        margin: 0;
        width: 100%;
    }
    
    #p-search > div {
        padding: 8px 0px 8px 1em;
    }

    #simpleSearch {
        width: 100%;
        max-width: 100%;
    }
    
    #mw-head #ca-nstab-main > a,
    #mw-head #ca-nstab-mediawiki > a {
        mask: url(/images/f/f1/Site-icon-read.svg) center/16px no-repeat;
    }
    
    #mw-head #ca-talk > a {
        mask: url(/images/f/f2/Site-icon-talk.svg) center/16px no-repeat;
    }
    
    #mw-head #ca-edit > a {
        mask: url(/images/2/2e/Site-icon-edit.svg) center/16px no-repeat;
    }
    
    #mw-head #ca-history > a {
        mask: url(/images/e/ea/Site-icon-history.svg) center/16px no-repeat;
    }
    
    #mw-head #p-cactions-label > span {
        mask: url(/images/0/0b/Site-icon-actions.svg) center/16px no-repeat;
    }
    
    #mw-head #ca-nstab-main > a,
    #mw-head #ca-nstab-mediawiki > a,
    #mw-head #ca-talk > a,
    #mw-head #ca-edit > a,
    #mw-head #ca-history > a,
    #mw-head #p-cactions-label > span {
        background: var(--header-icon-color);
        text-indent: -9999px;
        width: 20px;
        height: 20px;
    }
}

@media screen and (min-width: 962px) {
    #mw-panel {
        padding-left: 0.5em;
    }
}

@media screen and (min-width: 982px) {
    .vector-search-box {
        margin-right: 0.5em;
    }
}

/* Sidebar */
.portal {
    border: 5px solid var(--template-primary);
    background: var(--template-secondary);
    margin: 5px 0;
    padding: 0;
}

#mw-panel .portal > .vector-menu-heading {
    display: block;
    background: var(--template-tertiary);
    margin: 0;
    padding: 0.5em;
}

#mw-panel .portal > .vector-menu-content > ul {
    padding: 0;
}

/* Footer */
#footer {
    margin-left: 0;
}

#footer-info-copyright {
    position: relative;
}

#footer-info-copyright > div > img {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 88px;
    height: 31px;
}

@media only screen and (max-width: 720px) {
    #footer-poweredbyico,
    #footer-info-copyright > div > img {
        display: none;
    }
}

/* Tables */
table {
    display: table;
    white-space: normal;
    border-collapse: separate;
    border-spacing: revert;
}

table:is(.styled, .cargoTable) {
    background: var(--template-primary);
    border: 5px solid var(--template-tertiary);
    border-collapse: separate;
    
    display: block;
    overflow-x: auto;
    max-width: -moz-fit-content;
    max-width: fit-content;
}

table:is(.styled, .cargoTable) tr:first-child th {
      font-weight: normal;
      font-family: Helvetica, "Trebuchet MS", Verdana, sans-serif;
      font-size: 1.0em;
      height: 40px;
      padding: 0 20px;
      text-align: center;
      background-color: var(--template-sub-secondary);
      color: var(--template-text);
}

table:is(.styled, .cargoTable) th {
    background: var(--template-sub-tertiary);
    border-bottom: 1px solid var(--template-shadow);
}

table:is(.styled, .cargoTable, .cargoTable.mergeSimilarCells) td:is(td, .even, .odd) {
    background: var(--template-tertiary);
    padding: 0 5px 0;
    border: 0;
    border-bottom: 1px solid var(--template-shadow);
}

table.items tbody tr {
	height: 100px;
}


@media only screen and (max-width: 720px) {
    table.items .image {
        display: block;
        max-width: 100px;
        max-height: 100px;
    }
    
    table.items .image img {
        width: 100%;
        height: 100%;
    }
}

/*-- infobox -- example: https://backpackbattles.wiki.gg/wiki/Template:Item_infobox --*/
.infobox {
  float: right;
  clear: right;
  padding: 6px;
  margin: 0.5em 0 0.5em 1em;
  width: 25em;
  background-color: var(--theme-box-background);
  border: 1px solid var(--theme-box-border-color);
  border-radius: 8px;
  box-sizing: border-box;
  line-height: 1.5;
}

.infobox * {
  background: none;
}

.infobox table {
  background: none;
  width: 100%;
  border: 0;
  border-spacing: 0;
  white-space: normal;
}

.infobox table th,
.infobox table td {
  padding: 2px 0.3em;
  vertical-align: middle;
  border: 0;
}

.infobox table th {
  white-space: nowrap;
  text-align: right;
  width: 5em;
}

.infobox > .title,
.infobox .section > .title {
  border: 1px solid;
  border-color: var(--theme-box-border-color);
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  padding: 2px 0;
  margin: 6px 0;
}

.infobox > .title {
	font-size: 1.5em;
	margin-top: 0;
	background: var(--theme-accent-color);
	color: #fff;
}

.infobox .images {
  margin: 6px 0;
  min-height: 40px;
  text-align: center;
}

.infobox .image img {
	max-width: 100%;
	max-height: 300px;
	width: auto;
	height: auto;
}

.infobox ul {
  list-style: none;
  margin: auto;
}

.infobox .section.recipes ul {
	text-align: center;
}

.infobox:has(+ .infobox) {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.infobox + .infobox {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/*-- navbox -- example: https://backpackbattles.wiki.gg/wiki/Template:Items --*/
.navbox {
    border: 4px solid var(--template-primary);
    border-radius: 0px;
    display: table;
    width: 100%;
    margin: 0.5em auto;
    border-collapse: collapse;
}

.navbox-title {
    background: var(--template-tertiary)
}

.navbox-vde {
	position: absolute;
	left: 1em;
	font-size: 10px;
}

.navbox-title > th > .mw-collapsible-toggle {
    position: absolute;
    right: 0.5em;
}

.navbox-gutter > td {
    padding: 0;
    border-bottom: 1px solid var(--template-primary);
}

.navbox-group {
	background: var(--template-secondary);
    border-right: 1px solid var(--template-primary);
}

.navbox-list {
	background: var(--template-secondary);
	white-space: normal;
    padding: 0 .5em;
}