1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-05 15:45:27 +01:00

Show correct config link color in code boxes in dark mode

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz
2025-05-22 00:01:59 +02:00
parent 928ad4e454
commit 9a77bd829a

View File

@@ -69,7 +69,11 @@ export default function rehypeConfigLinker() {
if (currentHtml.includes(html)) {
currentHtml = currentHtml.replaceAll(
html,
`<a href="#${anchor}">${html}</a>`
// invertInDarkMode is to counteract the inversion of the
// surrounding <code> element in dark mode. The link color
// actually gets adjusted to the dark mode already, so we
// want to revert it to the original color.
`<a href="#${anchor}" class="invertInDarkMode">${html}</a>`
);
changed = true;
}