Page MenuHomePhabricator

Generated user stylesheet should not set text color
Closed, DeclinedPublic

Description

Author: z9z8z-wps

Description:
The "generated user stylesheet" (/w/index.php?title=-&action=raw&gen=css) is used to do special link formatting depending on the settings in the
user's preferences.

Among other things it defines text color #cc2200 for a.new and (if "highlightbroken" is set) #772233 for a.stub:after which don't belong there
because it does not know about the color scheme defined in other stylesheets. While it does not conflict with the current MediaWiki skins it is likely
to cause problems with any (user) skins that use different background colors.

Text and background colors should always be defined in the same place.


Version: unspecified
Severity: normal

Details

Reference
bz4561

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:02 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz4561.
bzimport added a subscriber: Unknown Object (MLST).

Please provide an example of such trouble.

I havent experienced any trouble with the dark theme 'Amethyst'.

z9z8z-wps wrote:

You would have had problems with highlightbroken turned off reading a "!" in color #772233 on the #2f333b background, and since user style
sheets are allowed I could easily come up with a brown or red theme.

The current solution is a quick "dirty" hack and restricts the choice of colors in skin style sheets where all these color definitions belong to. For
the same reason (not to define a text color without the background color) the PNGs of the math and hiero extension have a white and not
transparent background even though black on transparent would display well on the current standard skin backgrounds.

robchur wrote:

It's a problem if our code makes assumptions that might be reasonably be
expected to be incompatible.

robchur wrote:

*** Bug 6160 has been marked as a duplicate of this bug. ***

To clarify, this bug requests that the alternate styling for red-links is not defined statically in PHP where this is generated, but by the skin itself.

That's a bit complicated though since it can't be made part of the main skins' stylesheet since it should only be applied if this preference is enabled.

Possible solutions:

  • Let skins provide a separate css module for this module, and have a default fallback in case none is specified by the skin
  • Do let it be part of the main skins' stylesheet, but instead of overwriting a.new styles, let PHP output an additional class on all a.new links for this (e.g. <a class="new highlightbroken">).
  • Let it be as it is until this preference is deprecated and removed