diff mbox series

[1/2] theme_overrides.css: rework admonition colors

Message ID 20261029-admonitions-styling-v1-1-8990714284a1@bootlin.com
State New
Headers show
Series Rework admonition colors | expand

Commit Message

Antonin Godard Oct. 29, 2026, 12:58 p.m. UTC
All our current admonition are shown with the same colors: grey
background, blue title.

Change the warning, attention, caution, and important to have a
light yellow background, yellow title.

Change the danger and error admonitions to have a light red background,
red title.

Increase the spacing above the titles from 6px to 12px, so that
left/right and top/bottom spacing are all even, which renders better
since we do not have a different color for the title background.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/sphinx-static/theme_overrides.css | 45 +++++++++++++++++++------
 1 file changed, 35 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/documentation/sphinx-static/theme_overrides.css b/documentation/sphinx-static/theme_overrides.css
index 3823db820..81915b19c 100644
--- a/documentation/sphinx-static/theme_overrides.css
+++ b/documentation/sphinx-static/theme_overrides.css
@@ -163,27 +163,52 @@  section#welcome-to-the-yocto-project-documentation p.caption {
         color: inherit;
     }
 
-    /* Admonition should be gray, not blue or green */
+    /* Normal admonitions should be gray, not blue or green */
+    .rst-content .hint .admonition-title,
     .rst-content .note .admonition-title,
     .rst-content .tip .admonition-title,
-    .rst-content .warning .admonition-title,
-    .rst-content .caution .admonition-title,
-    .rst-content .admonition-tying-it-together .admonition-title,
-    .rst-content .important .admonition-title {
+    .rst-content .admonition-tying-it-together .admonition-title {
         background: #f0f0f2;
         color: #00557D;
-
+        padding: 12px 12px;
     }
 
+    .rst-content .hint,
     .rst-content .note,
     .rst-content .tip,
-    .rst-content .important,
-    .rst-content .warning,
-    .rst-content .admonition-tying-it-together,
-    .rst-content .caution  {
+    .rst-content .admonition-tying-it-together {
         background: #f0f0f2;
     }
 
+    /* For other admonitions, make the title background color the same as the
+     * admonitions' content, to be consistent with our note and tip admonitions. */
+    .rst-content .attention .admonition-title,
+    .rst-content .caution .admonition-title,
+    .rst-content .important .admonition-title,
+    .rst-content .warning .admonition-title {
+        background: #fff6e5;
+        color: #b37400;
+        padding: 12px 12px;
+    }
+
+    .rst-content .attention,
+    .rst-content .caution,
+    .rst-content .important,
+    .rst-content .warning {
+        background: #fff6e5;
+    }
+
+    .rst-content .danger .admonition-title,
+    .rst-content .error .admonition-title {
+        background: #fdf3f2;
+        color: #8d2f26;
+        padding: 12px 12px;
+    }
+    .rst-content .danger,
+    .rst-content .error {
+        background: #fdf3f2;
+    }
+
     /* Remove the icon in front of note/tip element, and before the logo */
     .icon-home:before, .rst-content .admonition-title:before {
         display: none