Page MenuHomePhabricator

Linter rule night-mode-unaware-background-color possible false positive with wrapped span tags
Closed, DeclinedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The code in question is:

<span style="background:red;color:yellow;">Foo <span style="background:blue">bar</span></span>

Observe that the text color is yellow in both boxes, as dictated by the "color:yellow" in the outer span.

What should have happened instead?:
There should be no background color Linter error. The color:yellow declaration applies to the text within the nested span tag, so there should be no problem with night mode.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

This is working as expected. The intention of this lint rule is to always define the color alongside the background, otherwise the night mode may break the rendering of this element.

This needs to be corrected to:

<span style="background:red;color:yellow;">Foo <span style="background:blue; color: inherit;">bar</span></span>
`

This shouldn't throw an error for signatures IMO so I've filed T360796.