ソースを参照

Update admonition styling

Co-authored-by: Justin McGettigan <[email protected]>
Yuri Sizov 2 年 前
コミット
f45c014fb1
3 ファイル変更9 行追加5 行削除
  1. 7 3
      _static/css/custom.css
  2. 1 1
      _templates/layout.html
  3. 1 1
      conf.py

+ 7 - 3
_static/css/custom.css

@@ -938,14 +938,19 @@ code,
 /* Admonition tweaks */
 .rst-content .admonition-grid {
     display: grid;
-    grid-template-columns: 4fr 5fr;
+    grid-template-columns: 1fr;
     gap: 20px;
 }
+.rst-content .admonition-grid-2x {
+    grid-template-columns: 4fr 5fr;
+}
 @media screen and (max-width: 1020px) {
     .rst-content .admonition-grid {
-        grid-template-columns: 1fr;
         gap: 12px;
     }
+    .rst-content .admonition-grid-2x {
+        grid-template-columns: 1fr;
+    }
 }
 
 .rst-content .admonition,
@@ -967,7 +972,6 @@ code,
     font-size: 105%;
     line-height: 120%;
     padding: 6px 16px;
-    text-align: right;
 }
 
 .rst-content .admonition .admonition-title:before {

+ 1 - 1
_templates/layout.html

@@ -27,7 +27,7 @@
 {%- block document %}
 <div itemprop="articleBody">
   {% if godot_is_latest or godot_show_article_status %}
-  <div class="admonition-grid">
+  <div class="admonition-grid {% if godot_is_latest and godot_show_article_status %}admonition-grid-2x{% endif %}">
     {% if godot_is_latest %}
     <div class="admonition attention latest-notice">
       <p class="first admonition-title">Attention</p>

+ 1 - 1
conf.py

@@ -195,7 +195,7 @@ html_extra_path = ["robots.txt"]
 html_css_files = [
     'css/algolia.css',
     'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css',
-    "css/custom.css?8", # Increment the number at the end when the file changes to bust the cache.
+    "css/custom.css?9", # Increment the number at the end when the file changes to bust the cache.
 ]
 
 if not on_rtd: