MediaWiki:Mobile.css: Difference between revisions

From Parallel Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Tag: Manual revert
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
@import url("/index.php?action=raw&ctype=text/css&title=MediaWiki:ParallelStyles.css");
/**
/**
You are editing the global css file for all mobile site users.
You are editing the global css file for all mobile site users.
Line 21: Line 19:
*/
*/


/* Reset user agent styles. We don't reset small or blockquote here deliberately */
/* Fix dumb default styling */
cite,
.content code,
dfn {
.content pre {
font-style: inherit;
background-color: #f9f9f9;
border: 1px solid #ddd;
color: black;
}
 
.content code {
border-radius: 2px;
}
 
@media all and (max-width: 768px) {
.gallerybox .thumb > div {
margin: 15px !important;
width: auto !important;
}
}
 
td {
background-color: #FFF;
}
 
/* Use black bullet points, instead of blue circles: [[File:List bullet.svg]] */
.content ul {
list-style-image: url('filepath://List_bullet.svg');
}
 
/* Fix footer hlist separator colour */
.footer-content .hlist-separated li:after {
color: #FFF;
}
 
/* Fix changes autocollapsing in recent changes */
.mw-changeslist-edit, .mw-changeslist-line {
display: table-row !important;
}
.mw-changeslist-line-inner {
padding-top: 1.5em;
}
.mw-enhanced-rc-nested {
    padding-top: 0.5em;
}
 
/* Alternating cell background */
.alternatecells:nth-child(odd) {
background-color: #F9F9F9;
}
 
/* Alternating table rows, primarily used with [[Template:Infobox row]] */
.alternaterows tr:nth-child(even),
.infobox-rows tr:nth-child(even),
.alternaterows tr:nth-child(even) td,
.infobox-rows tr:nth-child(even) td {
background-color: #F9F9F9;
}
 
/* Show TOC */
@media (max-width: 512px) {
.skin-minerva .toc-mobile {
display: block;
}
}
}


q {
/* Turn a list into a tree view style (See [[.minecraft]]) */
quotes: '"' '"' "'" "'";
.treeview {
margin-top: 0.3em;
}
}


/* Hide the images */
.treeview .treeview-header {
.geo-nondefault, .geo-multi-punct,
padding-left: 3px;
/* Hide stuff meant for accounts with special permissions. Made visible again in
font-weight: bold;
  [[MediaWiki:Group-sysop.css]], [[MediaWiki:Group-patroller.css]] and
}
  [[MediaWiki:Group-autoconfirmed.css]]. */
.treeview .treeview-header:last-child {
.checkuser-show,
border-color: #636363 !important;
.sysop-show,
border-left-style: dotted;
.templateeditor-show,
}
.extendedmover-show,
.treeview .treeview-header:not(:last-child):before {
.patroller-show,
content: none;
.extendedconfirmed-show,
}
.autoconfirmed-show,
.treeview .treeview-header:last-child:before {
/* Copied from Common.css - allow for hiding text in compact form e.g. clean up templates */
border-bottom: 0;
.hide-when-compact,
}
/* portal pages are badly formatted. Until this changes these should be hidden. (see https://phabricator.wikimedia.org/T86495) */
 
.noprint.portal {
.treeview ul,
.treeview li {
margin: 0;
padding: 0;
list-style-type: none;
list-style-image: none;
}
 
.treeview li li {
position: relative;
padding-left: 13px;
margin-left: 7px;
border-left: 1px solid #636363;
}
.treeview li li:before {
content: "";
position: absolute;
top: 0;
left: -1px;
width: 11px;
height: 11px;
border-bottom: 1px solid #636363;
}
 
.treeview li li:last-child:not(.treeview-continue) {
border-color: transparent;
}
.treeview li li:last-child:not(.treeview-continue):before {
border-left: 1px solid #636363;
width: 10px;
}
 
.nbttree-inherited {
background-color: #E6E6FA;
}
 
/* Try to use nearest neighbour scaling for pixelated images */
.pixel-image,
.invslot-item-image,
.sprite {
image-rendering: optimizeSpeed;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: crisp-edges;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
}
 
/* Simulate link styling for JS only links */
.jslink {
color: #0645AD;
-webkit-user-select: none;
  -moz-user-select: none;
    -ms-user-select: none;
        user-select: none;
}
.jslink:hover {
text-decoration: underline;
cursor: pointer;
}
.jslink:active {
color: #FAA700;
}
 
/* Hatnotes and disambiguation notices */
.hatnote {
font-style: italic;
}
.hatnote i {
font-style: normal;
}
div.hatnote {
padding-left: 1.6em;
margin-bottom: 0.5em;
}
div.hatnote + div.hatnote {
margin-top: -0.5em;
}
 
/* Fix animated infobox images shifting the screen when images have different dimensions */
.content span.animated a > img,
.content span.animated a > .lazy-image-placeholder,
.content noscript span.animated > img {
    max-width: initial !important;
}
 
body.page-Main_Page #firstHeading {
    display: none;
}
 
/* Hide nomobile */
.nomobile {
display: none;
display: none;
}
}


/*
 
.infobox
 
DO NOT style infobox's here. That should be taken care of in the associated templates via template styles. Styles here will lead to flash of unstyled content on mobile.
/* Try to use nearest neighbour scaling for pixelated images */
*/
.pixel-image,
/* removed inline from module as we work toward Tstyles support
.invslot-item-image,
* Use three classes to match specificity of MobileFrontend/Minerva selectors */
.sprite {
.content .mw-parser-output .infobox-header,
image-rendering: optimizeSpeed;
.content .mw-parser-output .infobox-subheader,
image-rendering: -webkit-optimize-contrast;
.content .mw-parser-output .infobox-above,
image-rendering: optimize-contrast;
.content .mw-parser-output .infobox-title,
image-rendering: -moz-crisp-edges;
.content .mw-parser-output .infobox-image,
image-rendering: -o-crisp-edges;
.content .mw-parser-output .infobox-full-data,
image-rendering: crisp-edges;
.content .mw-parser-output .infobox-below {
image-rendering: pixelated;
text-align: center;
-ms-interpolation-mode: nearest-neighbor;
}
}


/* Unbulleted lists e.g. Barack Obama page*/
 
.plainlist ul {
/* Classes corresponding to Minecraft formatting codes */
list-style: none;
.format-0 {
padding-left: 0; /* Reset Minerva defaults */
color: #000;
text-shadow: 0.125em 0.125em 0 #000;
}
}


/* Prevent line breaks in silly places:
.format-1 {
  1) Where desired
color: #00A;
  2) Links when we don't want them to
text-shadow: 0.125em 0.125em 0 #00002A;
*/
.mw-parser-output .nowrap,
.nowraplinks a {
white-space: nowrap;
}
}
.mw-parser-output .infobox .nowrap {
 
white-space: normal !important;
.format-2 {
color: #0A0;
text-shadow: 0.125em 0.125em 0 #002A00;
}
}
/* But allow wrapping where desired: */
 
.wrap,
.format-3 {
.wraplinks a {
color: #0AA;
white-space: normal;
text-shadow: 0.125em 0.125em 0 #002A2A;
}
}


/* Generic class texhtml class for inline math */
.format-4 {
span.texhtml {
color: #A00;
font-family: serif;
text-shadow: 0.125em 0.125em 0 #2A0000;
white-space: nowrap;
}
 
.format-5 {
color: #A0A;
text-shadow: 0.125em 0.125em 0 #2A002A;
}
}


/* Prevent flags in tables from collapsing
.format-6 {
Fix for T116318
color: #FA0;
*/
text-shadow: 0.125em 0.125em 0 #2A2A00;
.flagicon img {
min-width: 25px;
}
}


/* Prevent unnecessary margin at the bottom of centralnotices */
.format-7 {
.cnotice {
color: #AAA;
margin-bottom: 0 !important;
text-shadow: 0.125em 0.125em 0 #2A2A2A;
}
}


.format-8 {
color: #555;
text-shadow: 0.125em 0.125em 0 #151515;
}


/* The message body cell(s), such as for {{Commonscat}}.
.format-9 {
* this is a very small subset of the styles from Common.css
color: #55F;
* just to make sure the box isn't squashed without any spacing
text-shadow: 0.125em 0.125em 0 #15153F;
* which looks out of place with visuals of other nearby elements
*/
.mbox-text {
/* @noflip */
padding: 0.25em 0.9em;
}
}


/* Normal font styling for wikitable row headers with scope="row" tag */
.format-a {
.wikitable.plainrowheaders th[scope=row],
color: #5F5;
.wikitable.plainrowheaders th[scope=rowgroup] {
text-shadow: 0.125em 0.125em 0 #153F15;
font-weight: normal;
/* @noflip */
text-align: left;
}
}


.format-b {
color: #5FF;
text-shadow: 0.125em 0.125em 0 #153F3F;
}


/**
.format-c {
******************DEPRECATED STYLES ************************************
color: #F55;
These styles will be removed shortly. Please see inline comments.
text-shadow: 0.125em 0.125em 0 #3F1515;
**/
}


.format-d {
color: #F5F;
text-shadow: 0.125em 0.125em 0 #3F153F;
}


/*
.format-e {
FIXME: DUPLICATES Template:Hlist/styles.css
color: #FF5;
Note the mobile skin provides a `hlist-separated` class for this purpose. Use this class name alongside the hlist class instead as this will result in a FOUC.
text-shadow: 0.125em 0.125em 0 #3F3F15;
Should be removed and moved to templates.
*/
/* Counter hlist indenting of Minerva*/
.mw-parser-output .hlist ul,
.mw-parser-output .hlist ol {
padding-left: 0;
}
}
/* reset hlist margins of Minerva
 
do not add li here (see T235416) */
.format-f,
.mw-parser-output .hlist dd,
#minetip-tooltip {
.mw-parser-output .hlist dt {
color: #FFF;
margin-right: 0;
text-shadow: 0.125em 0.125em 0 #3F3F3F;
}
}
/* do not add li here. Minerva provides it already*/
 
.mw-parser-output .hlist dd:after {
.format-l {
content: " · ";
font-weight: bold;
font-weight: bold;
letter-spacing: 0.125em;
}
}
.mw-parser-output .hlist dt:after {
 
content: ": ";
.format-m {
text-decoration: line-through;
}
}


/* Should be removed and moved to templates once TemplateStyles is live */
.format-n {
.heading-holder .hlist li:after,
text-decoration: underline;
.mw-parser-output .hlist dd:last-child:after,
.mw-parser-output .hlist dt:last-child:after,
.mw-parser-output .hlist li:last-child:after {
content: none;
}
}
/* Add parentheses around nested lists */
 
/* Should be removed and moved to templates once TemplateStyles is live */
.format-o {
.mw-parser-output .hlist dd dd:first-child:before,
font-style: italic;
.mw-parser-output .hlist dd dt:first-child:before,
.mw-parser-output .hlist dd li:first-child:before,
.mw-parser-output .hlist dt dd:first-child:before,
.mw-parser-output .hlist dt dt:first-child:before,
.mw-parser-output .hlist dt li:first-child:before,
.mw-parser-output .hlist li dd:first-child:before,
.mw-parser-output .hlist li dt:first-child:before,
.mw-parser-output .hlist li li:first-child:before {
content: " (";
font-weight: normal;
}
}
/* Should be removed and moved to templates once TemplateStyles is live */
 
.mw-parser-output .hlist dd dd:last-child:after,
/* Styling for minecraft style tooltip */
.mw-parser-output .hlist dd dt:last-child:after,
#minetip-tooltip {
.mw-parser-output .hlist dd li:last-child:after,
position: fixed;
.mw-parser-output .hlist dt dd:last-child:after,
top: 0;
.mw-parser-output .hlist dt dt:last-child:after,
left: 0;
.mw-parser-output .hlist dt li:last-child:after,
background-color: #100010;
.mw-parser-output .hlist li dd:last-child:after,
background-color: rgba(16, 0, 16, 0.94);
.mw-parser-output .hlist li dt:last-child:after,
padding: 0.375em;
.mw-parser-output .hlist li li:last-child:after {
font-family: Minecraft, sans-serif;
content: ") " !important; /* Override hlist-separated being dumb */
font-size: 16px;
font-weight: normal;
word-spacing: 4px;
padding-left: 0;
white-space: nowrap;
line-height: 1.25em;
margin: 0.125em 0.25em;
pointer-events: none;
z-index: 9999;
}
}


/* Put ordinals in front of ordered list items */
#minetip-tooltip::before {
/* Should be removed and moved to templates once TemplateStyles is live */
content: "";
.mw-parser-output .hlist ol {
position: absolute;
counter-reset: listitem;
top: 0.125em;
right: -0.125em;
bottom: 0.125em;
left: -0.125em;
border: 0.125em solid #100010;
border-style: none solid;
border-color: rgba(16, 0, 16, 0.94);
}
}


/* Should be removed and moved to templates once TemplateStyles is live */
#minetip-tooltip::after {
.mw-parser-output .hlist ol > li {
content: "";
counter-increment: listitem;
position: absolute;
top: 0.125em;
right: 0;
bottom: 0.125em;
left: 0;
border: 0.125em solid #2D0A63;
border-image: -webkit-linear-gradient(rgba(80, 0, 255, 0.31), rgba(40, 0, 127, 0.31)) 1;
border-image: linear-gradient(rgba(80, 0, 255, 0.31), rgba(40, 0, 127, 0.31)) 1;
}
}


/* Should be removed and moved to templates once TemplateStyles is live */
#minetip-tooltip > .description,
.mw-parser-output .hlist ol > li:before {
#minetip-tooltip > .minetip-description {
content: " " counter(listitem) " ";
display: block;
white-space: nowrap;
margin-top: 0.25em;
}
}


/* Should be removed and moved to templates once TemplateStyles is live */
/* Styling for tooltip */
.mw-parser-output .hlist dd ol > li:first-child:before,
.explain {
.mw-parser-output .hlist dt ol > li:first-child:before,
border-bottom: 0;
.mw-parser-output .hlist li ol > li:first-child:before {
text-decoration: underline dotted;
content: " (" counter(listitem) " ";
cursor: help;
}
}


/* https://phabricator.wikimedia.org/T180396#5317728 */
/* Show help cursor when an abbr element has a title attribute */
 
abbr[title] {
@media print {
cursor: help;
.navbox,
.hatnote,
.ambox {
display: none !important;
}
}
}

Latest revision as of 22:28, 2 November 2023

/**
You are editing the global css file for all mobile site users.
With Great Power Comes Great Responsibility.

Some words of caution:
* Avoid any changes which impact layout on a mobile device.
** Please be careful not to introduce any margin / padding rules. These should be done inside the template itself via an inline style.
** Be especially cautious when a template is likely to be used within the top 480px of the screen (the content that the user will see first on a mobile device).
* Do not use display:none. Instead edit the template and markup the element you want to hide with the `nomobile` class.
* Try to keep rules as generic and minimal as possible. Do not have 2 selectors doing the same thing. Introduce a common class and use that instead.
* For big changes consult the [https://grafana.wikimedia.org/dashboard/db/mobile-2g grafana dashboard] to ensure you don't introduce any performance regressions.
* Group common css rules together where possible.

If you are looking for .mobile-float-reset (see [[:phab:T56176]]), use TemplateStyles instead.
.mobile-float-reset {    
	float: none !important;    
	width: 100% !important;    
}  
*/

/* Fix dumb default styling */
.content code,
.content pre {
	background-color: #f9f9f9;
	border: 1px solid #ddd;
	color: black;
}

.content code {
	border-radius: 2px;
}

@media all and (max-width: 768px) {
	.gallerybox .thumb > div {
		margin: 15px !important;
		width: auto !important;
	}
}

td {
	background-color: #FFF;
}

/* Use black bullet points, instead of blue circles: [[File:List bullet.svg]] */
.content ul {
	list-style-image: url('filepath://List_bullet.svg');
}

/* Fix footer hlist separator colour */
.footer-content .hlist-separated li:after {
	color: #FFF;
}

/* Fix changes autocollapsing in recent changes */
.mw-changeslist-edit, .mw-changeslist-line {
	display: table-row !important;
}
.mw-changeslist-line-inner {
	padding-top: 1.5em;
}
.mw-enhanced-rc-nested {
    padding-top: 0.5em;
}

/* Alternating cell background */
.alternatecells:nth-child(odd) {
	background-color: #F9F9F9;
}

/* Alternating table rows, primarily used with [[Template:Infobox row]] */
.alternaterows tr:nth-child(even),
.infobox-rows tr:nth-child(even),
.alternaterows tr:nth-child(even) td,
.infobox-rows tr:nth-child(even) td {
	background-color: #F9F9F9;
}

/* Show TOC */
@media (max-width: 512px) {
	.skin-minerva .toc-mobile {
		display: block;
	}
}

/* Turn a list into a tree view style (See [[.minecraft]]) */
.treeview {
	margin-top: 0.3em;
}

.treeview .treeview-header {
	padding-left: 3px;
	font-weight: bold;
}
.treeview .treeview-header:last-child {
	border-color: #636363 !important;
	border-left-style: dotted;
}
.treeview .treeview-header:not(:last-child):before {
	content: none;
}
.treeview .treeview-header:last-child:before {
	border-bottom: 0;
}

.treeview ul,
.treeview li {
	margin: 0;
	padding: 0;
	list-style-type: none;
	list-style-image: none;
}

.treeview li li {
	position: relative;
	padding-left: 13px;
	margin-left: 7px;
	border-left: 1px solid #636363;
}
.treeview li li:before {
	content: "";
	position: absolute;
	top: 0;
	left: -1px;
	width: 11px;
	height: 11px;
	border-bottom: 1px solid #636363;
}

.treeview li li:last-child:not(.treeview-continue) {
	border-color: transparent;
}
.treeview li li:last-child:not(.treeview-continue):before {
	border-left: 1px solid #636363;
	width: 10px;
}

.nbttree-inherited {
	background-color: #E6E6FA;
}

/* Try to use nearest neighbour scaling for pixelated images */
.pixel-image,
.invslot-item-image,
.sprite {
	image-rendering: optimizeSpeed;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: optimize-contrast;
	image-rendering: -moz-crisp-edges;
	image-rendering: -o-crisp-edges;
	image-rendering: crisp-edges;
	image-rendering: pixelated;
	-ms-interpolation-mode: nearest-neighbor;
}

/* Simulate link styling for JS only links */
.jslink {
	color: #0645AD;
	-webkit-user-select: none;
	   -moz-user-select: none;
	    -ms-user-select: none;
	        user-select: none;
}
.jslink:hover {
	text-decoration: underline;
	cursor: pointer;
}
.jslink:active {
	color: #FAA700;
}

/* Hatnotes and disambiguation notices */
.hatnote {
	font-style: italic;
}
.hatnote i {
	font-style: normal;
}
div.hatnote {
	padding-left: 1.6em;
	margin-bottom: 0.5em;
}
div.hatnote + div.hatnote {
	margin-top: -0.5em;
}

/* Fix animated infobox images shifting the screen when images have different dimensions */
.content span.animated a > img,
.content span.animated a > .lazy-image-placeholder,
.content noscript span.animated > img {
    max-width: initial !important;
}

body.page-Main_Page #firstHeading {
    display: none;
}

/* Hide nomobile */
.nomobile {
	display: none;
}



/* Try to use nearest neighbour scaling for pixelated images */
.pixel-image,
.invslot-item-image,
.sprite {
	image-rendering: optimizeSpeed;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: optimize-contrast;
	image-rendering: -moz-crisp-edges;
	image-rendering: -o-crisp-edges;
	image-rendering: crisp-edges;
	image-rendering: pixelated;
	-ms-interpolation-mode: nearest-neighbor;
}


/* Classes corresponding to Minecraft formatting codes */
.format-0 {
	color: #000;
	text-shadow: 0.125em 0.125em 0 #000;
}

.format-1 {
	color: #00A;
	text-shadow: 0.125em 0.125em 0 #00002A;
}

.format-2 {
	color: #0A0;
	text-shadow: 0.125em 0.125em 0 #002A00;
}

.format-3 {
	color: #0AA;
	text-shadow: 0.125em 0.125em 0 #002A2A;
}

.format-4 {
	color: #A00;
	text-shadow: 0.125em 0.125em 0 #2A0000;
}

.format-5 {
	color: #A0A;
	text-shadow: 0.125em 0.125em 0 #2A002A;
}

.format-6 {
	color: #FA0;
	text-shadow: 0.125em 0.125em 0 #2A2A00;
}

.format-7 {
	color: #AAA;
	text-shadow: 0.125em 0.125em 0 #2A2A2A;
}

.format-8 {
	color: #555;
	text-shadow: 0.125em 0.125em 0 #151515;
}

.format-9 {
	color: #55F;
	text-shadow: 0.125em 0.125em 0 #15153F;
}

.format-a {
	color: #5F5;
	text-shadow: 0.125em 0.125em 0 #153F15;
}

.format-b {
	color: #5FF;
	text-shadow: 0.125em 0.125em 0 #153F3F;
}

.format-c {
	color: #F55;
	text-shadow: 0.125em 0.125em 0 #3F1515;
}

.format-d {
	color: #F5F;
	text-shadow: 0.125em 0.125em 0 #3F153F;
}

.format-e {
	color: #FF5;
	text-shadow: 0.125em 0.125em 0 #3F3F15;
}

.format-f,
#minetip-tooltip {
	color: #FFF;
	text-shadow: 0.125em 0.125em 0 #3F3F3F;
}

.format-l {
	font-weight: bold;
	letter-spacing: 0.125em;
}

.format-m {
	text-decoration: line-through;
}

.format-n {
	text-decoration: underline;
}

.format-o {
	font-style: italic;
}

/* Styling for minecraft style tooltip */
#minetip-tooltip {
	position: fixed;
	top: 0;
	left: 0;
	background-color: #100010;
	background-color: rgba(16, 0, 16, 0.94);
	padding: 0.375em;
	font-family: Minecraft, sans-serif;
	font-size: 16px;
	word-spacing: 4px;
	white-space: nowrap;
	line-height: 1.25em;
	margin: 0.125em 0.25em;
	pointer-events: none;
	z-index: 9999;
}

#minetip-tooltip::before {
	content: "";
	position: absolute;
	top: 0.125em;
	right: -0.125em;
	bottom: 0.125em;
	left: -0.125em;
	border: 0.125em solid #100010;
	border-style: none solid;
	border-color: rgba(16, 0, 16, 0.94);
}

#minetip-tooltip::after {
	content: "";
	position: absolute;
	top: 0.125em;
	right: 0;
	bottom: 0.125em;
	left: 0;
	border: 0.125em solid #2D0A63;
	border-image: -webkit-linear-gradient(rgba(80, 0, 255, 0.31), rgba(40, 0, 127, 0.31)) 1;
	border-image: linear-gradient(rgba(80, 0, 255, 0.31), rgba(40, 0, 127, 0.31)) 1;
}

#minetip-tooltip > .description,
#minetip-tooltip > .minetip-description {
	display: block;
	margin-top: 0.25em;
}

/* Styling for tooltip */
.explain {
	border-bottom: 0;
	text-decoration: underline dotted;
	cursor: help;
}

/* Show help cursor when an abbr element has a title attribute */
abbr[title] {
	cursor: help;
}