Page MenuHomePhabricator

Dark/night mode shouldn't reset .metadata styles
Closed, DuplicatePublicBUG REPORT

Description

There are a few issues with this styles:

html.skin-theme-clientpref-night .metadata:not(.notheme) {
    background: inherit !important;
    color: inherit !important;
    border-color: var(--border-color-subtle, #c8ccd1) !important;
}
  1. .metadata is a logical class that is used by many other tools.
  2. Usage of !important rule which forces the usage !important in template styles to redefine it.
  3. Too specific selector that can't be easily redefined.

So with this code, there are only two solutions for template editors, and both are bad:

Instead, there should not be such a rule. If there is an issue for some particular projects, and they really need it until templates and styles are fixed, they can add it to a local wiki's Common.css. Or it can be added to all projects by a bot, so local interface admins can remove it later.

Event Timeline

Though I generally support this request because I think the metadata class is too generic to be targeting for color motivations, I have also made T365330: Split theme-night.less into component files which would solve this issue locally.

These styles are meant to reflect all projects and metadata is used in slightly different ways on other projects so I think it is not appropriate to remove this rule. I do think there is merit in rethinking how we organize these files so they can disabled more easily on wiki so I recommend we focus the discussion in T365330.

metadata is used in slightly different ways on other projects so I think it is not appropriate to remove this rule

That’s an argument to not have this rule in the first place.