Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #208

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
62 changes: 52 additions & 10 deletions wikipedia-dark.user.css
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,39 @@
@-moz-document regexp("https?:\/\/(([\w\-]{2,}\.)?(wiki(pedia|books|news|quote|source|versity|voyage)|wiktionary)|(www|test)\.(mediawiki|wiki(data|dot))|(meta|wikimania|commons|otrs-wiki|species|wikitech|incubator|outreach|foundation|donate)\.wikimedia)\.org\/.*"),
regexp("https?:\/\/wiki\.(archlinux|mozilla)\.(org|jp)\/.*$"),
regexp("https?:\/\/wikiless\.org\/.*$") {
#vector-toc {
background-color: transparent;
}
.tracklist th[scope="col"] {
background-color: var(--gray-3) !important;
}
caption {
background-color: var(--gray-3) !important;
border-color: var(--gray-5) !important;
}
button.mw-collapsible-toggle {
border-color: var(--gray-5);
}
button.mw-collapsible-toggle::after,
button.mw-collapsible-toggle::before {
color: var(--gray-5);
}
.tracklist-total-length span,
.tracklist-total-length td {
background-color: var(--gray-3) !important;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding new blocks for these rules, find one of the aggregated block of selectors implementing this rule and add the selectors there. This style is broken into sections based on the element being modified, and the colors being applied.

.infobox-data {
background-color: var(--gray-2) !important;
}
.infobox-header {
border-color: var(--gray-5) !important;
}
Comment on lines +443 to +448
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two rules no longer seem to be necessary after #206 was applied. If you find an area where it appears to be needed, we can revisit this one. Also try to avoid low specificity selectors using !important, where possible.

td[style*="background:#FFB" i] {
background: var(--yellow-2) !important;
}
td[style*="background:#BBF3FF" i] {
background: var(--blue-1) !important;
}
/* transparent background */
html,
body,
Expand All @@ -439,7 +472,7 @@
}
div.vectorTabs ul li,
tt[style="background: white;"],
span:not(.legend-color):not([class*="wikEd"]):not([style*="background"]):not(.wikibase-toolbar-wrapper):not(.tool),
span:not(.legend-color):not([class*="wikEd"]):not([style*="background"]):not(.wikibase-toolbar-wrapper):not(.tool):not(.tracklist-total-length span),
tr[style*="background:#F5FFFA" i],
th[style*="background-color: #fff" i],
blockquote[style*="background-color: white" i],
Expand All @@ -463,10 +496,10 @@
.mw-body-content .portal ul,
.wikitable > tr,
.wikitable > tr > th,
.wikitable > tr > td,
.wikitable > * > tr,
.wikitable > tr > td:not([style*="background-color"]),
.wikitable > * > tr:not([bgcolor]),
.wikitable > * > tr > th,
.wikitable > * > tr > td:not(.break):not([style^="background:"]):not([bgcolor]),
.wikitable > * > tr > td:not(.break):not([style*="color"]):not([style*="background"]):not([bgcolor]),
.wikitable th span[style*="background"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a high potential for collateral damage, especially given the amount of custom wikitable colors and styles employed on Wikipedia. Until they have more specific fixes, this rule remains necessary.

I would be hesitant to accept this change without reviewing quite a few wikitables with color scales to ensure it has the desired effect. We man find this starts an endless game of whack-a-mole.

.inline-quote-talk,
.oo-ui-fieldsetLayout-group .oo-ui-widget,
Expand Down Expand Up @@ -497,7 +530,7 @@
.mw-mmv-permission-box,
.mw-mmv-info-box {
border-color: var(--gray-5);
background-color: transparent !important;
background-color: transparent;
}
div.vectorTabs li.selected,
.vector-header-container,
Expand All @@ -509,7 +542,7 @@
.ve-ui-mwSaveDialog-options,
.mw-parser-output #siteContainer div:first-child,
#mw-page-base {
background-color: transparent;
background-color: transparent !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer necessary after the background fix in #206.

Making the table of contents transparent is closer aligned with the original style though.

}
.lang-list-button {
border-color: var(--gray-5);
Expand Down Expand Up @@ -928,12 +961,13 @@
.infobox-above[style*="background: #DEDEE2;"],
.infobox-above[style*="background-color: #E7DCC3;"],
.infobox-above[style="background:Silver"],
.infobox-above[style*="background-color: lightsteelblue"],
.wikitable[style*="background-color:#f7f8ff"] tbody {
background-color: var(--gray-3) !important;
}
.ve-ui-mwParameterResultWidget.oo-ui-optionWidget-highlighted,
.infobox-above[style=""],
.infobox-header[style=""] {
.infobox-above,
.infobox-header {
background-color: var(--gray-3);
}
table[class="toccolours;"] tr[style*="background:#FAFAFA"],
Expand Down Expand Up @@ -2309,6 +2343,8 @@
td[style*="background: #ffdddd" i],
tr[style*="background:#FFDDDD" i],
tr[style*="background:#fbb" i],
td[style*="background:#FBB" i],
tr[bgcolor="#FFBBBB"],
.table-no {
background: var(--red-3) !important;
color: var(--gray-d) !important;
Expand Down Expand Up @@ -2386,7 +2422,8 @@
div[style*="border: 1px solid #BF4D40"] {
border: 1px solid var(--red-3) !important;
}
.no.table-no2 {
.no.table-no2,
.table-no2 {
background-color: var(--red-3) !important;
}
/* Green */
Expand Down Expand Up @@ -2539,9 +2576,11 @@
td[style*="background: #99FF99;" i],
td[style*="background:#dfd" i],
td[style*="background:#bfd" i],
td[style*="background-color:#FFBBBB" i],
tr[style*="background:#DDFFDD" i],
tr[style*="background:#bfb" i],
tr[style*="background-color:#CCFFCC" i],
tr[bgcolor="#CCFFCC" i],
.table-yes {
background: var(--green-2) !important;
color: var(--gray-d) !important;
Expand Down Expand Up @@ -3666,7 +3705,9 @@
td[style*="background-color: #FDD"] {
background-color: var(--pink-1) !important;
}
td[style*="background-color: #F9D"] {
td[style*="background-color: #F9D"],
td[style*="background-color: #E0CEF2" i],
td[bgcolor="EOCEF2"] {
background-color: var(--pink-2) !important;
}
div[style="background-color: #fff5f5; margin: 2em 0 0 0; padding: 0 10px 0 10px; border: 1px solid #AAAAAA;"] {
Expand Down Expand Up @@ -3721,6 +3762,7 @@
table.wikitable,
button.formBtn {
border: 1px solid var(--gray-5) !important;
background-color: var(--gray-2) !important;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is handling borders, so adding rules affecting backgrounds is not appropriate here (and will cause collateral damage). A more specific selector should be chosen for this rule as well.

fieldset,
button[type="submit"]:not(.pure-button-primary-progressive):not(.formBtn),
Expand Down