From 02bd0c7532f8bc961da933fddbf6fe838769c97f Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 4 Oct 2026 19:45:36 +0800 Subject: [PATCH] DOC: Render field list headings in the same style as rubrics Render the headings of field lists (e.g., "Parameters", "Returns") in the same style as rubrics (e.g., "Examples", "Notes"), instead of in a grey box. Co-Authored-By: Claude Opus 5.5 --- doc/_static/style.css | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/_static/style.css b/doc/_static/style.css index 4d958532f1f..13fda786aa4 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -79,7 +79,7 @@ html.writer-html5 .rst-content dl.field-list { display: initial; } -/* Add a grey box around parameters similar to sphinx_rtd_theme v4.x.x) */ +/* Add a grey box around nested definitions (e.g., class members) similar to sphinx_rtd_theme v4.x.x */ .rst-content dl:not(.docutils) dl dt { margin-bottom: 4px; border: none; @@ -100,6 +100,32 @@ html.writer-html5 .rst-content dl.field-list { position: relative; } +/* + * Render the headings of field lists (e.g., "Parameters", "Returns") in the same style + * as rubrics (e.g., "Examples", "Notes"), overriding the grey box defined above. + */ +.rst-content dl:not(.docutils) dl.field-list > dt { + display: block; + margin: 0 0 12px 0; + padding: 0; + border: none; + background: none; + color: inherit; + font-size: 1.05em; + font-weight: 700; + line-height: inherit; +} + +/* Add space between consecutive fields (e.g., between "Parameters" and "Returns") */ +.rst-content dl:not(.docutils) dl.field-list > dd + dt { + margin-top: 24px; +} + +/* Remove the trailing colon from the field list headings, like the rubrics */ +.rst-content dl.field-list > dt .colon { + display: none; +} + /* Remove the padding from the Parameters table */ .rst-content table.field-list .field-name { padding-left: 0px;