FilterStrings

FilterStrings exposes selected CSS custom properties (variables) with hexadecimal color values as custom properties with strings that can be fed to an element's filter property to turn black into the specific color.
== ==
== ==
By default, the script doesn't do anything. The variables that will be relied upon in the CSS should be listed. This is done by listing the variables in MediaWiki:Custom-FilterStrings-config-vars line-by-line. For example:
--theme-link-color
--theme-link-color--hover
== ==
The variables will be injected into the inline style of the document, which means they are available everywhere. The name is generated by appending --filter to the original name.
It is recommended to define a --fallback value as well:
.theme-fandomdesktop-dark {
 --theme-link-color--filter--fallback: invert(1);
}
svg {
 filter: var(--theme-link-color--filter, var(--theme-link-color--filter--fallback));
}