User:3PPYB6/dark-mode.css: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
Content deleted Content added
Import from w:en:MediaWiki:Gadget-dark-mode.css, see its page history for more information.
 
 
Line 1: Line 1:
/* WikimediaUI Dark Mode
/* WikimediaUI Dark Mode
*
*
* Wikimedia Design Team 2019-2021
* Wikimedia Design Team 2019-2021
* Original authors:
* Original authors:
* - Volker E. – [[User:Volker_E._(WMF)]]
* - Volker E.
* - Alex Hollender
* - Alex Hollender
* - MusikAnimal
* - MusikAnimal
* - Carolyn Li-Madeo
* - Carolyn Li-Madeo
* - Jdlrobson
* - Jdlrobson
*
* Original at https://en.wikipedia.org/wiki/User:Volker_E._(WMF)/dark-mode.css
* Version for Gadget CSS skin override usage only.
* Basically removed of all interaction element styles and
* set to `html` instead of JS injected `.client-dark-mode` class.
*
*
* Last updated: 2021-04-20
* Last updated: 2021-04-20
Line 18: Line 13:
*/
*/


@media screen {
/** To prevent 'jumping' effect within #p-personal in Vector/Monobook. Overrides [[MediaWiki:Gadget-dark-mode-toggle-pagestyles.css]] **/

body.skin-vector-legacy :not(#pt-darkmode) + #pt-watchlist::before,
/* Switch to dark mode */
body.skin-monobook :not(#pt-darkmode) + #pt-watchlist::before {
/* Inspired by MusikAnimal */
content: "Light mode";
#pt-darkmode a:before {
/* Moon icon */
content: '\263E';
display: inline-block;
padding: 0 2px;
}
}


/* Switch to default mode */
@media screen {
.client-dark-mode #pt-darkmode a:before {
/* Sun icon */
/* set height for monobook and timeless, because the filter in FF needs dimensions to get it to apply */
content: '\2600';
html {
font-weight: bold;
height: 100%;
}
}


/* Would be nice if it were that easy. Will have to find opposite color for invert filter to make it dark
/* Filter needs to reside on `html`, see https://phabricator.wikimedia.org/T221425#5153917 */
.client-dark-mode {
html,
background-color: #000;
}
*/

/* Filter needs to reside on `html`: `html.client-dark-mode`, see https://phabricator.wikimedia.org/T221425#5153917 */
.client-dark-mode,
/* All other selectors have `filter` double-applied to turn back to “normal” by inheritance */
/* All other selectors have `filter` double-applied to turn back to “normal” by inheritance */
html img,
.client-dark-mode img,
html video,
.client-dark-mode video,
.client-dark-mode svg,
html ogvjs,
.client-dark-mode iframe,
html svg,
.client-dark-mode .mw-no-invert,
html iframe,
.client-dark-mode .mwe-math-element,
html .mw-no-invert,
.client-dark-mode .wvui-typeahead-suggestion__thumbnail,
html td .diffchange,
html .mwe-math-element,
html .wvui-typeahead-suggestion__thumbnail,
html .skin-minerva .mw-notification-visible .mw-notification-content,
/* Extensions */
/* Extensions */
html .cx-slitem__image,
.client-dark-mode .cx-slitem__image,
html .mw-mmv-overlay,
.client-dark-mode .mw-mmv-overlay,
html .mw-mmv-pre-image,
.client-dark-mode .mw-mmv-pre-image,
html .mw-kartographer-map,
.client-dark-mode .mw-kartographer-map,
html .mw-kartographer-mapDialog-map,
.client-dark-mode .mw-kartographer-mapDialog-map,
html .ext-related-articles-card-list .ext-related-articles-card-thumb {
.client-dark-mode .ext-related-articles-card-list .ext-related-articles-card-thumb {
filter: invert( 1 ) hue-rotate( 180deg );
filter: invert( 1 ) hue-rotate( 180deg );
}
}


/* Reset overrides, needed where double application above isn't working. */
/* Reset overrides */
.client-dark-mode .skin-vector .mw-logo-wordmark,
/* Vector modern */
html .skin-vector .mw-logo-wordmark,
.client-dark-mode .skin-vector .mw-logo-tagline,
.client-dark-mode .wvui-icon svg {
html .skin-vector .mw-logo-tagline,
html .skin-timeless .mw-wiki-title > img,
html .wvui-icon svg {
filter: none;
filter: none;
}
}


/* Backgrounds */
/* Backgrounds */
html table,
.client-dark-mode table,
html table.ambox-content,
.client-dark-mode table.ambox-content,
html table.toccolours,
.client-dark-mode table.toccolours,
html .mw-notification,
.client-dark-mode .mw-notification,
html .mwe-popups,
.client-dark-mode .mwe-popups,
html .infobox,
.client-dark-mode .infobox,
html .toc,
.client-dark-mode .toc,
html .thumbinner,
.client-dark-mode .thumbinner,
html .wikitable,
.client-dark-mode .wikitable,
html .cbnnr-main,
.client-dark-mode .cbnnr-main,
html .cx-callout,
.client-dark-mode .cx-callout,
html #simpleSearch,
.client-dark-mode #simpleSearch,
html #simpleSearch #searchInput,
.client-dark-mode #simpleSearch #searchInput,
html #siteNotice #centralNotice .cnotice {
.client-dark-mode #siteNotice #centralNotice .cnotice {
background-color: #ddd;
background-color: #ddd;
}
}


/* Borders */
/* Borders */
html body,
.client-dark-mode body,
.client-dark-mode h1,
html h1,
.client-dark-mode h2,
html h2,
.client-dark-mode h3,
html h3,
.client-dark-mode h4,
html h4,
.client-dark-mode h5,
html h5,
.client-dark-mode h6,
html h6,
html table.ambox-content,
.client-dark-mode table.ambox-content,
html table.toccolours,
.client-dark-mode table.toccolours,
html .mw-notification,
.client-dark-mode .mw-notification,
html .infobox,
.client-dark-mode .infobox,
html .toc,
.client-dark-mode .toc,
html .thumbinner,
.client-dark-mode .thumbinner,
html #mw-head,
.client-dark-mode #mw-head,
html #mw-panel,
.client-dark-mode #mw-panel,
html #content.mw-body,
.client-dark-mode #content.mw-body,
html #simpleSearch,
.client-dark-mode #simpleSearch,
html #simpleSearch #searchInput,
.client-dark-mode #simpleSearch #searchInput,
html #siteNotice #centralNotice .cnotice {
.client-dark-mode #siteNotice #centralNotice .cnotice {
border-color: #cdcbc8;
border-color: #cdcbc8;
}
}
Line 106: Line 107:
/* Links */
/* Links */
/* Links: normal */
/* Links: normal */
.client-dark-mode a,
html a,
html .vector-menu-tabs li a,
.client-dark-mode .vector-menu-tabs li a,
/* Backwards compatible VectorTabs, deprecated in MW v1.35. */
/* Backwards compatible VectorTabs, deprecated in MW v1.35. */
html .vectorTabs li a,
.client-dark-mode .vectorTabs li a,
html .toctogglelabel,
.client-dark-mode .toctogglelabel,
html .mw-parser-output a.external,
.client-dark-mode .mw-parser-output a.external,
html .mw-parser-output a.extiw,
.client-dark-mode .mw-parser-output a.extiw,
html .mw-parser-output a.extiw:active,
.client-dark-mode .mw-parser-output a.extiw:active,
html #mw-panel .portal .body li a {
.client-dark-mode #mw-panel .portal .body li a {
/* color: #69f; Proposal below for level AA conformance, see also https://phabricator.wikimedia.org/T233266
/* color: #69f; Proposal below for level AA conformance, see also https://phabricator.wikimedia.org/T233266
`#36c` is transformed by :root `filter` to be closer to chosen `#69f`. */
`#36c` is transformed by :root `filter` to be closer to chosen `#69f`. */
color: #36c;
color: #36c;
Line 121: Line 122:


/* Links: visited */
/* Links: visited */
html a:visited,
.client-dark-mode a:visited,
html .mw-parser-output a.extiw:visited,
.client-dark-mode .mw-parser-output a.extiw:visited,
html #mw-panel .portal .body li a:visited {
.client-dark-mode #mw-panel .portal .body li a:visited {
/* color: #709bbd; Proposal below uses to-be-standardized color from https://phabricator.wikimedia.org/T213778 */
/* color: #709bbd; Proposal below uses to-be-standardized color from https://phabricator.wikimedia.org/T213778 */
color: #6b4ba1;
color: #6b4ba1;
Line 129: Line 130:


/* Links: red */
/* Links: red */
html a.new,
.client-dark-mode a.new,
html .vector-menu-tabs li.new a,
.client-dark-mode .vector-menu-tabs li.new a,
html .vectorTabs li.new a {
.client-dark-mode .vectorTabs li.new a {
color: #ff6e6e;
color: #ff6e6e;
}
}
Line 137: Line 138:
/* ::: Special Element Treatments ::: */
/* ::: Special Element Treatments ::: */
/* Image thumbnails */
/* Image thumbnails */
html .thumbimage {
.client-dark-mode .thumbimage {
border: 0;
border: 0;
}
}
Line 143: Line 144:
/* Content image (thumbnail) SVGs */
/* Content image (thumbnail) SVGs */
/* `*not( .mbox-image )` exception doesn't work for unclear reasons */
/* `*not( .mbox-image )` exception doesn't work for unclear reasons */
html .image img[ src*='svg' ],
.client-dark-mode .image img[ src*='svg' ],
html img[ src*='Wiktionary-logo'] {
.client-dark-mode img[ src*='Wiktionary-logo'] {
background-color: #fff;
background-color: #fff;
border-radius: 1px;
border-radius: 1px;
Line 150: Line 151:


/* Dealing with false positives from selector above */
/* Dealing with false positives from selector above */
html .mw-echo-ui-notificationItemWidget-icon img[ src*='svg' ],
.client-dark-mode .mw-echo-ui-notificationItemWidget-icon img[ src*='svg' ],
html .mbox-image .image img[ src*='svg' ],
.client-dark-mode .mbox-image .image img[ src*='svg' ],
/* Emoji generated by [[Template:Emoji]] */
html .emoji .image img,
/* Vote symbols on Talk pages */
/* Vote symbols on Talk pages */
html .image img[ alt^="Symbol" ] {
.client-dark-mode .image img[ alt^="Symbol" ] {
background-color: transparent;
background-color: transparent;
}
}


/* Page previews */
/* Page previews */
html .mwe-popups {
.client-dark-mode .mwe-popups {
box-shadow: 0 30px 90px -20px rgba( 0, 0, 0, 0.3 ), 0 0 1px #000;
box-shadow: 0 30px 90px -20px rgba( 0, 0, 0, 0.3 ), 0 0 1px #000;
}
}


html .mwe-popups.flipped-y:after,
.client-dark-mode .mwe-popups .mwe-popups-extract[ dir='ltr' ]:after {
background-image: -webkit-linear-gradient( 90deg, rgba( 221, 221, 221, 0 ), #ddd 50% );
html .mwe-popups.flipped-x-y:after {
background-image: -moz-linear-gradient( 90deg, rgba( 221, 221, 221, 0 ), #ddd 50% );
background-image: linear-gradient( 90deg, rgba( 221, 221, 221, 0 ), #ddd 50% );
}

.client-dark-mode .mwe-popups.flipped-y:after,
.client-dark-mode .mwe-popups.flipped-x-y:after {
border-top: 11px solid #ddd;
border-top: 11px solid #ddd;
}
}


html .mwe-popups.mwe-popups-no-image-pointer:after {
.client-dark-mode .mwe-popups.mwe-popups-no-image-pointer:after {
border-bottom: 11px solid #ddd;
border-bottom: 11px solid #ddd;
}
}


/* Contributions menu */
/* Contributions menu */
html .cx-callout-1:after {
.client-dark-mode .cx-callout-1:after {
border-bottom-color: #ddd;
border-bottom-color: #ddd;
}
}


/* Mobile Wikipedia logo mobile header */
/* ::: Skin specific rules ::: */
/* Wikipedia globe fix */
html .branding-box img {
.skin-vector #p-logo.mw-no-invert,
filter: brightness( 0 );
.skin-timeless #p-logo.mw-no-invert {
position: absolute;
top: 0;
height: 112px;
overflow: hidden;
}
}


/* Timeless globe fix */
.skin-timeless #mw-site-navigation {
position: relative;
}

.skin-timeless #p-logo.mw-no-invert {
left: 1em;
height: 124px;
}

/* Mobile Wikipedia logo mobile header */
.client-dark-mode .branding-box img {
filter: brightness( 0 );
}
}


@-moz-document url-prefix() {
body {
background: #000;
}
}
}

Latest revision as of 00:53, 5 April 2022

/* WikimediaUI Dark Mode 
 *
 * Wikimedia Design Team 2019-2021 
 * Original authors:
 * - Volker E.
 * - Alex Hollender
 * - MusikAnimal
 * - Carolyn Li-Madeo
 * - Jdlrobson
 *
 * Last updated: 2021-04-20
 *
 */

@media screen {

/* Switch to dark mode */
/* Inspired by MusikAnimal */
#pt-darkmode a:before {
	/* Moon icon */
	content: '\263E';
	display: inline-block;
	padding: 0 2px;
}

/* Switch to default mode */
.client-dark-mode #pt-darkmode a:before {
	/* Sun icon */
	content: '\2600';
	font-weight: bold;
}

/* Would be nice if it were that easy. Will have to find opposite color for invert filter to make it dark 
.client-dark-mode {
	background-color: #000;
}
*/

/* Filter needs to reside on `html`: `html.client-dark-mode`, see https://phabricator.wikimedia.org/T221425#5153917 */
.client-dark-mode,
/* All other selectors have `filter` double-applied to turn back to “normal” by inheritance */
.client-dark-mode img, 
.client-dark-mode video, 
.client-dark-mode svg, 
.client-dark-mode iframe, 
.client-dark-mode .mw-no-invert, 
.client-dark-mode .mwe-math-element,
.client-dark-mode .wvui-typeahead-suggestion__thumbnail,
/* Extensions */
.client-dark-mode .cx-slitem__image,
.client-dark-mode .mw-mmv-overlay, 
.client-dark-mode .mw-mmv-pre-image, 
.client-dark-mode .mw-kartographer-map, 
.client-dark-mode .mw-kartographer-mapDialog-map,
.client-dark-mode .ext-related-articles-card-list .ext-related-articles-card-thumb {
	filter: invert( 1 ) hue-rotate( 180deg );
}

/* Reset overrides */
.client-dark-mode .skin-vector .mw-logo-wordmark,
.client-dark-mode .skin-vector .mw-logo-tagline,
.client-dark-mode .wvui-icon svg {
	filter: none;
} 

/* Backgrounds */
.client-dark-mode table,
.client-dark-mode table.ambox-content,
.client-dark-mode table.toccolours,
.client-dark-mode .mw-notification,
.client-dark-mode .mwe-popups,
.client-dark-mode .infobox,
.client-dark-mode .toc,
.client-dark-mode .thumbinner,
.client-dark-mode .wikitable,
.client-dark-mode .cbnnr-main,
.client-dark-mode .cx-callout,
.client-dark-mode #simpleSearch,
.client-dark-mode #simpleSearch #searchInput,
.client-dark-mode #siteNotice #centralNotice .cnotice {
	background-color: #ddd;
}

/* Borders */
.client-dark-mode body,
.client-dark-mode h1,
.client-dark-mode h2,
.client-dark-mode h3,
.client-dark-mode h4,
.client-dark-mode h5,
.client-dark-mode h6,
.client-dark-mode table.ambox-content,
.client-dark-mode table.toccolours,
.client-dark-mode .mw-notification,
.client-dark-mode .infobox,
.client-dark-mode .toc,
.client-dark-mode .thumbinner,
.client-dark-mode #mw-head,
.client-dark-mode #mw-panel,
.client-dark-mode #content.mw-body,
.client-dark-mode #simpleSearch,
.client-dark-mode #simpleSearch #searchInput,
.client-dark-mode #siteNotice #centralNotice .cnotice {
	border-color: #cdcbc8;
}

/* Links */
/* Links: normal */
.client-dark-mode a,
.client-dark-mode .vector-menu-tabs li a,
/* Backwards compatible VectorTabs, deprecated in MW v1.35. */
.client-dark-mode .vectorTabs li a,
.client-dark-mode .toctogglelabel,
.client-dark-mode .mw-parser-output a.external,
.client-dark-mode .mw-parser-output a.extiw,
.client-dark-mode .mw-parser-output a.extiw:active,
.client-dark-mode #mw-panel .portal .body li a {
	/* color: #69f; Proposal below for level AA conformance, see also https://phabricator.wikimedia.org/T233266 
	   `#36c` is transformed by :root `filter` to be closer to chosen `#69f`. */
	color: #36c;
}

/* Links: visited */
.client-dark-mode a:visited,
.client-dark-mode .mw-parser-output a.extiw:visited,
.client-dark-mode #mw-panel .portal .body li a:visited {
	/* color: #709bbd; Proposal below uses to-be-standardized color from https://phabricator.wikimedia.org/T213778 */
	color: #6b4ba1;
}

/* Links: red */
.client-dark-mode a.new,
.client-dark-mode .vector-menu-tabs li.new a,
.client-dark-mode .vectorTabs li.new a {
	color: #ff6e6e;
}

/* ::: Special Element Treatments ::: */
/* Image thumbnails */
.client-dark-mode .thumbimage {
	border: 0;
}

/* Content image (thumbnail) SVGs */
/* `*not( .mbox-image )` exception doesn't work for unclear reasons */
.client-dark-mode .image img[ src*='svg' ],
.client-dark-mode img[ src*='Wiktionary-logo'] {
	background-color: #fff;
	border-radius: 1px;
}

/* Dealing with false positives from selector above */
.client-dark-mode .mw-echo-ui-notificationItemWidget-icon img[ src*='svg' ],
.client-dark-mode .mbox-image .image img[ src*='svg' ],
/* Vote symbols on Talk pages */
.client-dark-mode .image img[ alt^="Symbol" ] {
	background-color: transparent;
}

/* Page previews */
.client-dark-mode .mwe-popups {
    box-shadow: 0 30px 90px -20px rgba( 0, 0, 0, 0.3 ), 0 0 1px #000;
}

.client-dark-mode .mwe-popups .mwe-popups-extract[ dir='ltr' ]:after {
	background-image: -webkit-linear-gradient( 90deg, rgba( 221, 221, 221, 0 ), #ddd 50% );
	background-image: -moz-linear-gradient( 90deg, rgba( 221, 221, 221, 0 ), #ddd 50% );
	background-image: linear-gradient( 90deg, rgba( 221, 221, 221, 0 ), #ddd 50% );
}

.client-dark-mode .mwe-popups.flipped-y:after,
.client-dark-mode .mwe-popups.flipped-x-y:after {
	border-top: 11px solid #ddd;
}

.client-dark-mode .mwe-popups.mwe-popups-no-image-pointer:after {
	border-bottom: 11px solid #ddd;
}

/* Contributions menu */
.client-dark-mode .cx-callout-1:after {
	border-bottom-color: #ddd;
}

/* ::: Skin specific rules ::: */
/* Wikipedia globe fix */
.skin-vector #p-logo.mw-no-invert,
.skin-timeless #p-logo.mw-no-invert {
	position: absolute;
	top: 0;
	height: 112px;
	overflow: hidden;
}

/* Timeless globe fix */
.skin-timeless #mw-site-navigation {
	position: relative;
}

.skin-timeless #p-logo.mw-no-invert {
	left: 1em;
	height: 124px;
}

/* Mobile Wikipedia logo mobile header */
.client-dark-mode .branding-box img {
	filter: brightness( 0 );
}

}