From 2d6058fe66f9eee99b7613d6477ea89d776ecc06 Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Fri, 13 Dec 2024 19:12:47 +0800 Subject: [PATCH] fix: code editor styles in admonitions (#931) --- src/scss/custom.scss | 8 +++++++- src/theme/Admonition/Layout/styles.module.css | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/scss/custom.scss b/src/scss/custom.scss index 8ba30d94d81..fd80c241fc9 100644 --- a/src/scss/custom.scss +++ b/src/scss/custom.scss @@ -795,11 +795,17 @@ table { } } - code { + code:not(pre code) { background-color: var(--logto-container-neutral-bg); } } +html[data-theme='dark'] { + .alert pre code { + background-color: #181132; + } +} + .alert--info, .alert--secondary { --ifm-alert-background-color: var(--logto-container-info-bg); diff --git a/src/theme/Admonition/Layout/styles.module.css b/src/theme/Admonition/Layout/styles.module.css index 6f85d23aafa..dc933781f66 100644 --- a/src/theme/Admonition/Layout/styles.module.css +++ b/src/theme/Admonition/Layout/styles.module.css @@ -39,10 +39,10 @@ > p:first-of-type { display: inline; - } - p + p { - margin-block: 1rem 0; + + * { + margin-block: 1rem; + } } .title {