StylishThemes/Wikipedia-Dark

Bad contrast in table with colored cells

dragnev-dev opened this issue · 4 comments

The cells of the table have colored background so with the theme default white font color the text becomes hardly readable.

Timeline of discovery of Solar System planets and their moons – Prehistorically discovered

Timeline_discovery_Solar_System#Prehistorically

This one was just bad styling of the wikitable, which I've now edited to make the cells inherit their color from the rows.

Before edit

before

After edit

after

Afterwords, the style's existing fixes solve the rest.

Afterwords, the style's existing fixes solve the rest.

So all colors removed which breaks the idea of having color coded backgrounds...

So all colors removed which breaks the idea of having color coded backgrounds...

Considering the number of articles that have color-coded tables in various forms, with different types of foreground matter (text, pictures, diagrams, etc.), I think handling all but the common cases would probably require a style generator. It would need to not only produce the darker versions of the background, but assess the contrast with foreground text and adjust each accordingly. Otherwise, a color pairing that looks fine in one article might be illegible when used in another, and unfortunately, a good majority of the wiki templates haven't been converted to use TemplateStyles yet, so classes are rare (and won't help with article-specific tables anyway).

I wonder if dark table background colors might be better handled as a userscript, in that case...

Problem is there is no way to do style generation of inline color styles. These will always will need to be handled manually until theres a better way, that would maybe need someone to write a dedicated js module for the task or something else.

Also the only way to assess and generate lightness/darkness would be to use preprocessor stylus and use stylus lang, the current wikipedia style is incompatible with that preprocessor as is, the css would need to be adjusted (massive undertaking IMO)

A userscript also possible to do such computation, but again until there's a robust solution the best way is to manually override pages like this because the table colors matter, hence issue #

TLDR
Having said that, Im not deving this anymore, so Im OK with whatever you decide or will decide.