From 1858bf48a3042b86d53fc29580de2a81622da43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 6 Sep 2024 08:49:40 +0200 Subject: [PATCH] notice: fix styling for Markdown code boxes #906 --- exampleSite/content/shortcodes/notice.en.md | 26 +++++++++++---------- static/css/theme.css | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/exampleSite/content/shortcodes/notice.en.md b/exampleSite/content/shortcodes/notice.en.md index aca0e49502..ce8c15628f 100644 --- a/exampleSite/content/shortcodes/notice.en.md +++ b/exampleSite/content/shortcodes/notice.en.md @@ -313,27 +313,29 @@ Just a box #### Code with Collapsed Colored Borders ```` -```c -// Normal code: -printf( "Hello world\n" ) -``` +> [!orange] +> ```c +> // With colored border in Markdown syntax +> printf( "Hello world\n" ) +> ``` -{{%/* notice style="red" title="" */%}} +{{%/* notice style="red" */%}} ```c -// With colored border +// With colored border in Shortcode syntax printf( "Hello world\n" ) ``` {{%/* /notice */%}} ```` -```c -// Normal code: -printf( "Hello world\n" ) -``` +> [!orange] +> ```c +> // With colored border in Markdown syntax +> printf( "Hello world\n" ) +> ``` -{{% notice style="red" title="" %}} +{{% notice style="red" %}} ```c -// With colored border +// With colored border in Shortcode syntax printf( "Hello world\n" ) ``` {{% /notice %}} diff --git a/static/css/theme.css b/static/css/theme.css index 7936a9e22f..9f704b3c4c 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -722,11 +722,11 @@ div.box > .box-content { padding-right: 1rem; } /* remove margin if only a single code block is contained in the tab */ -#R-body .box-content:has(> div.highlight:only-child){ +#R-body .box-content:has(> div.highlight:only-of-type){ padding: 0; } /* remove border from a code block if single */ -#R-body .box-content > div.highlight:only-child > pre{ +#R-body .box-content > div.highlight:only-of-type > pre{ border: 0; }