From 2a58ff3e416e2cfdec0e670489f9ebe5baaf2e22 Mon Sep 17 00:00:00 2001 From: dario-piotrowicz Date: Sat, 2 Oct 2021 10:16:02 +0300 Subject: [PATCH] fix(docs-infra): amend color of code links inside single anchors (#43586) when some auto code links fail to happen they can be added manually with the md ``[`code text`](link)``, these generate anchor elements which contain a code element, such code element does not get the correct text color, this commit fixes such issue PR Close #43586 --- aio/src/styles/2-modules/code/_code-theme.scss | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aio/src/styles/2-modules/code/_code-theme.scss b/aio/src/styles/2-modules/code/_code-theme.scss index a644c4de656..a8df6735154 100644 --- a/aio/src/styles/2-modules/code/_code-theme.scss +++ b/aio/src/styles/2-modules/code/_code-theme.scss @@ -87,15 +87,17 @@ } .sidenav-content { - code { - a { - color: if($is-dark-theme, constants.$cyan, constants.$darkblue); - } + code a, + a > code { + color: if($is-dark-theme, constants.$cyan, constants.$darkblue); } :not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(pre) { > code { background-color: if($is-dark-theme, constants.$darkgray, rgba(constants.$lightgray, 0.3)); + } + + &:not(a) > code { color: if($is-dark-theme, constants.$white, constants.$darkgray); } }