User:Sameerhameedy/Gadget-dark-mode.css

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Note: You may have to bypass your browser’s cache to see the changes. In addition, after saving a sitewide CSS file such as MediaWiki:Common.css, it will take 5-10 minutes before the changes take effect, even if you clear your cache.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

/* WikimediaUI Dark Mode
 *
 * Wikimedia Design Team 2019-2021
 * Original authors:
 * - Volker E. – [[User:Volker_E._(WMF)]]
 * - Alex Hollender
 * - MusikAnimal
 * - Carolyn Li-Madeo
 * - 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 `.client-dark-mode` instead of JS injected `.client-dark-mode` class.
 *
 * Last updated: 2021-04-20
 *
 */

/* 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;
}
*/

/** 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,
body.skin-monobook :not(#pt-darkmode) + #pt-watchlist::before {
	content: "Light mode";
}

@media screen {
	
/* set height for monobook and timeless, because the filter in FF needs dimensions to get it to apply */
.client-dark-mode {
    height: 100%;
}

/* Filter needs to reside on `.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:not( .mw-invert ),
.client-dark-mode video:not( .mw-invert ),
.client-dark-mode ogvjs:not( .mw-invert ),
.client-dark-mode svg:not( .mw-invert ),
.client-dark-mode iframe:not( .mw-invert ),
.client-dark-mode .mw-no-invert,
.client-dark-mode .cdx-no-invert,
.client-dark-mode td .diffchange,
.client-dark-mode .wvui-typeahead-suggestion__thumbnail,
.client-dark-mode .skin-minerva .mw-notification-visible .mw-notification-content,
.client-dark-mode .oo-ui-searchWidget-results .oo-ui-iconElement-icon,
.client-dark-mode .list-thumb,
/* Extensions */
.client-dark-mode .media-viewer .image img,
.client-dark-mode .media-viewer .mw-file-description img {
	filter: invert( 1 ) hue-rotate( 180deg );
}

/* Reset overrides, needed where double application above isn't working. */
/* Vector modern */
.client-dark-mode .skin-vector .mw-logo-wordmark,
.client-dark-mode .skin-vector .mw-logo-tagline,
.client-dark-mode .skin-timeless .mw-wiki-title > img,
.client-dark-mode .wvui-icon svg,
.client-dark-mode .mw-ext-score img,
.client-dark-mode .mw-hiero-table img {
	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 figure[typeof~='mw:File/Thumb'],
.client-dark-mode figure[typeof~='mw:File/Frame'],
.client-dark-mode figure[typeof~='mw:File/Thumb'] > figcaption,
.client-dark-mode figure[typeof~='mw:File/Frame'] > figcaption,
.client-dark-mode .wikitable,
.client-dark-mode .cbnnr-main,
.client-dark-mode .cx-callout,
.client-dark-mode .overlay.media-viewer,
.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 figure[typeof~='mw:File/Thumb'],
.client-dark-mode figure[typeof~='mw:File/Frame'],
.client-dark-mode figure[typeof~='mw:File/Thumb'] > figcaption,
.client-dark-mode figure[typeof~='mw:File/Frame'] > figcaption,
.client-dark-mode #mw-head,
.client-dark-mode #mw-panel,
/* Vector 2022 uses a transparent border for margin collapsing
(T312822) so don't apply this rule there */
.skin-vector-legacy #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,
.client-dark-mode figure[typeof~='mw:File/Thumb'] > :not(figcaption) .mw-file-element,
.client-dark-mode figure[typeof~='mw:File/Frame'] > :not(figcaption) .mw-file-element {
	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 .mw-file-description 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' ],
.client-dark-mode .mbox-image .mw-file-description img[ src*='svg' ],
/* Emoji generated by [[Template:Emoji]] */
.client-dark-mode .emoji .image img,
.client-dark-mode .emoji .mw-file-description img,
/* Vote symbols on Talk pages */
.client-dark-mode .image img[ alt^="Symbol" ],
.client-dark-mode .mw-file-description 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.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;
}

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

}

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

@-moz-document url-prefix() {   
	@supports (overflow-clip-margin: 1px) {     
		body {
			background: #fff;
		}   
	}
}