Use Jenkins theme CSS color variables for inverse text #306
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original support for negative/inverse text uses a combination off
currentColor
and a bright-level-7 value. When using a default Jenkins theme, these color definitions work as expected. However, clients using the dark theme may not be able to read the text since both the text and background are a bright color.Modern Jenkins themes provide CSS color variables. Instead of trying to rely on
currentColor
, use the default text color (var(--text-color)
) and the default background color (var(--background)
). This should allow negative/inverse text to render appropriately no matter what theme mode is used.Testing done
With unit test changes that seemed to be right (please check), perform a
mvn test
to confirm expected results.Started up a fresh Jenkins container instance and setup a pipeline job with the following:
Before the changes, installed the ansicolor plugin from the online and observed the issue:
Then uninstalled the plugin, restarted and manually installed a newly built
ansicolor.hpi
plugin. Navigated back to the job results and observed that the inversed text could be read:Submitter checklist