From f23f17a8a9abc6d7ef8a1e04a5816b2b88b1c2b8 Mon Sep 17 00:00:00 2001 From: Asvin Goel Date: Tue, 19 Sep 2023 15:26:13 +0200 Subject: [PATCH] Style for inline code --- style.css | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/style.css b/style.css index 2f295d0..bf51d1e 100644 --- a/style.css +++ b/style.css @@ -48,24 +48,21 @@ kbd { /********************************************* * Inline code *********************************************/ -:not(pre) > code { - background-color: darkgray!important; - padding: 4px 4px 4px 4px; - border-radius: 4px; - text-shadow: none; - font-family: courier; -} + /* Inline code is also used to escape math blocks. The rendered math is then embedded within a span and should not receive the code background. */ -:not(pre) > code > span { - background-color: var(--r-background-color); - padding: 0; - border-radius: 0px; +code:not(:empty):not(:has(*)):not(pre code) { + background-color: darkgray; + padding: 4px 4px 4px 4px; + border-radius: 4px; + text-shadow: none; + font-family: courier; } + /********************************************* * Fragments *********************************************/