MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
fix mathml |
||
Line 569: | Line 569: | ||
} | } | ||
/* | /** Suppress fallback MathML implementation: most browsers support it natively. **/ | ||
.math { | /* -*- Mode: CSS; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=2 et sw=2 tw=80: */ | |||
/* This Source Code Form is subject to the terms of the Mozilla Public | |||
* License, v. 2.0. If a copy of the MPL was not distributed with this | |||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |||
/* Retrieved from https://github.com/fred-wang/webextension-native-mathml/blob/master/content-scripts/mediawiki.css */ | |||
/* Reset some CSS properties set by MediaWiki and hide the image fallback */ | |||
.mwe-math-mathml-a11y { | |||
clip: auto; | |||
overflow: visible; | |||
position: static; | |||
width: auto; | |||
height: auto; | |||
opacity: 1; | |||
display: inherit; | |||
} | |||
body.mediawiki .ve-ce-mwLatexNode .mwe-math-mathml-a11y { | |||
/* override https://phabricator.wikimedia.org/diffusion/EMAT/browse/master/modules/ve-math/ve.ce.MWLatexNode.css */ | |||
display: inherit; | |||
} | |||
/* Support where MediaWiki lazy loaded images */ | |||
.mwe-math-mathml-inline ~ .lazy-image-placeholder, | |||
.mwe-math-mathml-display ~ .lazy-image-placeholder, | |||
/* Support where MediaWiki doesn't lazy load images */ | |||
.mwe-math-mathml-inline + .mwe-math-fallback-image-inline, | |||
.mwe-math-mathml-display + .mwe-math-fallback-image-display { | |||
display: none; | |||
} | } |
Revision as of 20:58, 23 November 2023
/* CSS placed here will be applied to all skins */
:is(h4, h5, h6) .mw-editsection {
display: none;
}
/* This one is a legacy blur class. It may be removed in the future. **/
.bg3wiki-spoiler-blur {
filter: blur(3px);
opacity: 0.2;
transition-property: filter, opacity;
transition-duration: .4s;
}
.bg3wiki-spoiler-blur:hover, .bg3wiki-spoiler-blur:focus {
filter: none;
opacity: 1;
}
/* The following are the new blur classes. */
.bg3wiki-spoiler-blur-hoverable:hover, .bg3wiki-spoiler-blur-hoverable:focus {
filter: none;
opacity: 1;
}
.bg3wiki-spoiler-blur-link {
filter: blur(3.5px);
opacity: 1.0;
transition-property: filter, opacity;
transition-duration: .1s;
}
.bg3wiki-spoiler-blur-paragraph {
filter: blur(3px);
opacity: 0.2;
transition-property: filter, opacity;
transition-duration: .4s;
}
.bg3wiki-spoiler-blur-image {
filter: contrast(5%) blur(3px);
opacity: 0.5;
transition-property: filter, opacity;
transition-duration: .4s;
}
/* Book text, shared css */
.bg3wiki-book-text {
box-shadow:
rgba(0, 0, 0, 0.14) 3px 3px 6px 0px inset,
rgba(0, 0, 0, 0.14) -3px -3px 6px 1px inset;
border: 0.15rem solid #785000;
border-radius: 10px;
padding: 30px 40px;
}
.bg3wiki-book-text p {
font-family: 'Linux Libertine', 'Georgia', serif;
font-size: 1.2rem;
max-width: 800px;
margin: auto;
}
/* Item, spell, etc. properties */
.bg3wiki-property-list dt {
font-weight: normal;
}
.bg3wiki-property-list dd {
margin-left: 0;
}
.mw-content-ltr ul.bg3wiki-property-list {
margin-left: 0;
list-style: none;
}
/* ItemIcon rarity colors */
:root {
--bg3wiki-itemicon-common: 72, 72, 72;
--bg3wiki-itemicon-uncommon: 1, 189, 57;
--bg3wiki-itemicon-rare: 1, 191, 255;
--bg3wiki-itemicon-very-rare: 209, 1, 123;
--bg3wiki-itemicon-legendary: 183, 134, 29;
--bg3wiki-itemicon-story: 255, 89, 1;
--bg3wiki-itemicon-gradient-top-opacity: 0%;
--bg3wiki-itemicon-gradient-bot-opacity: 12.5%;
--bg3wiki-itemicon-border-opacity: 60%;
--bg3wiki-tooltip-border: #785000;
}
.bg3wiki-itemicon-wrapper {
text-align: center;
}
/* The value of --bg3wiki-rarity-color will be set per rarity class. */
.bg3wiki-itemicon {
display: inline-block;
background: linear-gradient(
rgba(var(--bg3wiki-rarity-color), var(--bg3wiki-itemicon-gradient-top-opacity)),
rgba(var(--bg3wiki-rarity-color), var(--bg3wiki-itemicon-gradient-bot-opacity))
);
border: solid 1px rgba(var(--bg3wiki-rarity-color), var(--bg3wiki-itemicon-border-opacity));
}
.bg3wiki-itemicon-common {
--bg3wiki-rarity-color: var(--bg3wiki-itemicon-common);
}
.bg3wiki-itemicon-uncommon {
--bg3wiki-rarity-color: var(--bg3wiki-itemicon-uncommon);
}
.bg3wiki-itemicon-rare {
--bg3wiki-rarity-color: var(--bg3wiki-itemicon-rare);
}
.bg3wiki-itemicon-very-rare {
--bg3wiki-rarity-color: var(--bg3wiki-itemicon-very-rare);
}
.bg3wiki-itemicon-legendary {
--bg3wiki-rarity-color: var(--bg3wiki-itemicon-legendary);
}
.bg3wiki-itemicon-story {
--bg3wiki-rarity-color: var(--bg3wiki-itemicon-story);
}
/* Coordinates */
body .bg3wiki-coordinates {
font-family: 'Linux Libertine', 'Times New Roman', serif;
text-shadow: 1px 1px 2px #000, -1px -1px 2px #000;
color: #AB9F89;
background: #34323285;
border-radius: 5px;
padding: 3px 5px;
box-shadow: 1px 1px 5px #00000030;
}
/* Tooltip box: imitating in-game tooltips and item icons */
body .bg3wiki-tooltip-box {
background: var(--bg3wiki-tooltip-bg);
box-shadow:
rgba(0, 0, 0, 0.14) 3px 3px 6px 0px inset,
rgba(0, 0, 0, 0.14) -3px -3px 6px 1px inset;
border: 0.15rem solid var(--bg3wiki-tooltip-border);
border-radius: 10px;
padding: 15px;
}
/* Relative Location stuff */
.relative-location {
background: var(--bg3wiki-relative-location-bg);
border: 1px solid var(--bg3wiki-tooltip-border);
border-spacing: 0;
box-shadow: 0 0.25rem 0.35rem -0.25rem rgba(0, 0, 0, 0.1);
margin: 5px;
text-align: center;
}
.relative-location-header {
background: var(--bg3wiki-relative-location-header-bg-dark);
}
/* Some mild styling of the CharacterInfo infobox */
.infobox td.characterinfo {
padding-left: 38px;
vertical-align: top;
}
/* Damage Rider As Source (DRS) template */
.bg3wiki-damage-rider-source {
font-size:10px;
vertical-align: top;
font-style: italic;
}
/* For mobile eyes only */
.nodesktop {
display: none;
}
/* License box */
#mw-license-preview .bg3wiki-license-box-container {
margin: auto auto auto 0; /* Don't want margin in the preview box because that breaks things */
}
.bg3wiki-license-box-container {
margin: 4px 0 4px 10%;
}
.bg3wiki-license-box {
border: 2px solid var(--bg3wiki-tooltip-border);
border-collapse: collapse;
background: var(--bg3wiki-tooltip-bg);
color: var(--bg3wiki-license-color);
width: 100%;
}
.bg3wiki-license-box-image {
border-right: none;
padding: 0.4rem 0 0.4rem 0.9rem;
}
.bg3wiki-license-box-text {
border-left: none;
vertical-align: top;
padding: 0.4rem 0 0.4rem 0.9rem;
}
/* Hat note */
.hatnote {
font-style: italic;
padding-left: 1.6em;
margin-bottom: 0.5em;
}
/* Price calculator */
#bg3wiki-price-calculator {
border: 1px solid var(--bg3wiki-tooltip-border);
}
#bg3wiki-price-calculator-form {
padding: 0.5em;
}
#bg3wiki-price-calculator-form input[type="number"] {
width: 100%;
}
#bg3wiki-price-calculator-form td {
padding-right: 0.5em;
}
#bg3wiki-price-calculator-form th {
text-align: right;
padding-right: 0.5em;
}
#bg3wiki-price-calculator-form label {
margin-left: 0.2em;
}
#bg3wiki-price-calculator-result {
margin: 1em;
}
#bg3wiki-price-calculator-result td, #bg3wiki-price-calculator-result th {
text-align: right;
}
/*
CSS tooltip implementation. Usage in markup:
<some-element aria-label="tooltip text here">
normal text
</some-element>
*/
[aria-label]:hover, [aria-label]:focus {position: relative}
[aria-label]:hover::after,
[aria-label]:focus::after {
position: absolute;
white-space: pre;
line-height: 1;
padding: 0.3rem;
content: attr(aria-label);
background-color: var(--aria-label-tooltip-bg);
color: var(--aria-label-tooltip-fg);
border: var(--aria-label-tooltip-border);
text-decoration: unset;
/* See optional override below. */
bottom: 100%;
left: 0;
}
/* Changes the tooltip position. */
[aria-label].aria-label-top-rig:hover::after,
[aria-label].aria-label-top-rig:focus::after {
bottom: 100%;
left: unset;
right: 0;
}
/* Optional class for indicating tooltip presence via underline. */
.bg3wiki-help-tooltip[aria-label] {
cursor: help;
text-decoration-line: underline;
text-decoration-style: dotted;
text-decoration-thickness: 1px;
text-underline-offset: calc(1ex / 2);
}
/**
Navbox classes
**/
.bg3wiki-navbox {
text-align: center;
border:1px solid var(--bg3wiki-tooltip-border);
font-size:95%;
color: var(--bg3wiki-navbox-header-text);
background-color: var(--bg3wiki-navbox-bg);
width: 100%;
}
.bg3wiki-navbox-header {
font-weight: bold;
font-size: 105%;
background-color: var(--bg3wiki-navbox-header-bg);
border: 0px none;
}
.bg3wiki-navbox-side-header {
background-color: var(--bg3wiki-navbox-header-bg);
}
.bg3wiki-navbox-side-secondary-header {
background-color: var(--bg3wiki-navbox-header-secondary-bg);
}
/* The actual contents of the navbox. */
.bg3wiki-navbox-content {
text-align: left;
padding: 0 4px;
}
/* Wikitext sometimes inserts implicit <p>s */
.bg3wiki-navbox-content p {
color: var(--bg3wiki-navbox-header-text);
}
/* Classes for gameplay navboxes */
.bg3wiki-gameplay-navbox {
color: var(--bg3wiki-navbox-header-text);
background-color: var(--bg3wiki-gameplay-navbox-bg);
margin-top: 1rem;
border: 1px solid var(--bg3wiki-tooltip-border);
width: 100%;
}
.bg3wiki-gameplay-navbox-header {
background-color: var(--bg3wiki-gameplay-navbox-header-bg);
text-align: center;
}
.bg3wiki-gameplay-navbox-row-header {
font-size: 95%;
padding: 0.75rem;
}
.bg3wiki-gameplay-navbox-content {
border: 0px none;
font-size: 95%;
padding-left: 1ch;
}
/**
Hack to display category trees as a navbox. Only used on NavModding and NavGuides for now.
**/
.navcat div > .CategoryTreeSection::after {
content: " · ";
font-weight: bold;
}
.navcat div > .CategoryTreeSection:last-child::after {
content: none;
}
.navcat div > .CategoryTreeTag,
.navcat div > .CategoryTreePageBullet {
display: none;
margin: 0;
padding: 0;
}
.navcat div {
display: inline;
margin: 0;
padding: 0;
padding-left: 0;
}
/* UID widget styling. */
.bg3wiki-uid {
display: inline-block;
}
.bg3wiki-uid summary {
display: inline-block;
list-style: none;
margin: 2px 0;
}
.bg3wiki-uid summary span {
text-decoration: underline dotted;
cursor: pointer;
}
.bg3wiki-uid tt, .bg3wiki-uid-box {
border: 1px dashed var(--bg3wiki-tooltip-border);
user-select: all;
padding: 0 0.5rem;
}
/**
Format for references. For now adds a text for each list. Safe to use, easy to add to and remove from.
**/
.refact1::before {
content: "Act 1";
text-decoration: none;
background: none;
font-style: italics;
font-size: 100%;
font-weight: bold;
direction: ltr;
}
.refact2::before {
content: "Act 2";
text-decoration: none;
background: none;
font-style: italics;
font-size: 100%;
font-weight: bold;
direction: ltr;
}
.refact3::before {
content: "Act 3";
text-decoration: none;
background: none;
font-style: italics;
font-size: 100%;
font-weight: bold;
direction: ltr;
}
.refurl::before {
content: "External links";
text-decoration: none;
background: none;
font-style: italics;
font-size: 100%;
font-weight: bold;
direction: ltr;
}
.refnote::before {
content: "Notes";
text-decoration: none;
background: none;
font-style: italics;
font-size: 100%;
font-weight: bold;
direction: ltr;
}
div.reflist ol.references {
list-style-type: inherit; /* Enable custom list style types */
}
/* Documentation css */
.ts-doc-doc {
background-color: var(--bg3wiki-documentation-bg);
/* border: 1px solid var(--bg3wiki-documentation-border); */
}
.ts-doc-header {
background-color: var(--bg3wiki-documentation-header-bg);
}
.ts-doc-footer {
background-color: var(--bg3wiki-documentation-bg);
border: 1px solid var(--bg3wiki-documentation-border);
}
/* Info blob */
div.bg3wiki-info-blob {
display: inline-block;
padding: 0 1em 0 1em;
border-radius: 20px;
}
span.bg3wiki-info-blob {
display: inline-block;
padding: 0 0.5em 0 0.5em;
border-radius: 10px;
}
.bg3wiki-info-blob {
font-family: monospace;
}
/* number inside AC shield */
.bg3wiki-ac-value {
display: grid;
justify-items:start;
align-items: start
}
.bg3wiki-ac-value > div {
grid-column-start: 1;
grid-row-start: 1;
}
.bg3wiki-ac-value .ac-value {
text-align:center;
width: 40px;
align-self: center;
padding-bottom: 0.5ch
}
.bg3wiki-ac-value .ac-value-comment {
grid-column-start: 2;
grid-row-start: 1;
align-self: center
}
/* Tab bar */
.bg3wiki-tabbar {
background-color: var(--bg3wiki-tabbar-bg);
}
.bg3wiki-tabbar .bg3wiki-tab {
padding:0 10px;
display: inline-block;
}
.bg3wiki-tabbar .bg3wiki-tab-active {
background-color: var(--bg3wiki-tabbar-active-bg);
color: var(--bg3wiki-tabbar-active-color);
}
/* Spoiler warning */
.bg3wiki-spoiler-warning {
background: linear-gradient(to right, var(--bg3wiki-spoiler-warning-start), var(--bg3wiki-spoiler-warning-end));
align-items:center;
border-radius:10px;
padding: 5px;
display: flex;
flex-wrap: wrap;
}
.bg3wiki-spoiler-warning.bg3wiki-spoiler-warning-no-grad {
background: transparent;
}
.bg3wiki-spoiler-warning strong {
color: var(--bg3wiki-spoiler-warning-strong-color);
}
/* Widget: Interactive map */
.bg3wiki-lower-city-map {
background-color: var(--bg3wiki-lower-city-map-bg);
border: 1px solid var(--bg3wiki-tooltip-border);
}
.bg3wiki-lower-city-map-svg {
background-color: var(--bg3wiki-lower-city-map-inner-bg);
}
/** Suppress fallback MathML implementation: most browsers support it natively. **/
/* -*- Mode: CSS; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Retrieved from https://github.com/fred-wang/webextension-native-mathml/blob/master/content-scripts/mediawiki.css */
/* Reset some CSS properties set by MediaWiki and hide the image fallback */
.mwe-math-mathml-a11y {
clip: auto;
overflow: visible;
position: static;
width: auto;
height: auto;
opacity: 1;
display: inherit;
}
body.mediawiki .ve-ce-mwLatexNode .mwe-math-mathml-a11y {
/* override https://phabricator.wikimedia.org/diffusion/EMAT/browse/master/modules/ve-math/ve.ce.MWLatexNode.css */
display: inherit;
}
/* Support where MediaWiki lazy loaded images */
.mwe-math-mathml-inline ~ .lazy-image-placeholder,
.mwe-math-mathml-display ~ .lazy-image-placeholder,
/* Support where MediaWiki doesn't lazy load images */
.mwe-math-mathml-inline + .mwe-math-fallback-image-inline,
.mwe-math-mathml-display + .mwe-math-fallback-image-display {
display: none;
}