From 8eed3a2be72bdc848dbdf892a7485ff9188b3340 Mon Sep 17 00:00:00 2001 From: Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> Date: Wed, 31 Aug 2022 17:35:48 +0300 Subject: [PATCH] Fix the styling of the HTML shell reference (#6119) Co-authored-by: Hugo Locurcio --- _static/css/custom.css | 77 +++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/_static/css/custom.css b/_static/css/custom.css index 22432b5f5..3dd77188e 100644 --- a/_static/css/custom.css +++ b/_static/css/custom.css @@ -304,74 +304,83 @@ hr, } /* JavaScript documentation directives */ -.rst-content dl:not(.docutils) dt { - background-color: var(--admonition-note-background-color) !important; +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list) > dt { + background-color: var(--admonition-note-background-color); border-color: var(--admonition-note-title-background-color); color: var(--admonition-note-color); } -.rst-content dl:not(.docutils) dl dt { - background-color: var(--admonition-attention-background-color); - border-color: var(--admonition-attention-title-background-color); - color: var(--admonition-attention-color) !important; +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl dt { + background-color: transparent; + border-color: transparent; + color: var(--footer-color); } -.rst-content dl:not(.docutils).class dt, -.rst-content dl:not(.docutils).function dt, -.rst-content dl:not(.docutils).method dt, -.rst-content dl:not(.docutils).attribute dt { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute dt { + font-weight: 600; + padding: 0 8px; + margin-bottom: 1px; width: 100%; } -.rst-content dl:not(.docutils).class > dt, -.rst-content dl:not(.docutils).function > dt, -.rst-content dl:not(.docutils).method > dt, -.rst-content dl:not(.docutils).attribute > dt { - font-size: 100%; +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class > dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function > dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method > dt, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute > dt { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace; + font-size: 90%; font-weight: normal; margin-bottom: 16px; padding: 6px 8px; } -.rst-content dl:not(.docutils) tt.descclassname, -.rst-content dl:not(.docutils) code.descclassname { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-prename.descclassname { color: var(--highlight-type2-color); font-weight: normal; } -.rst-content dl:not(.docutils) tt.descname, -.rst-content dl:not(.docutils) code.descname { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name.descname { color: var(--highlight-function-color); - font-weight: normal; + font-weight: 700; } -.rst-content dl:not(.docutils) .sig-paren, -.rst-content dl:not(.docutils) .optional { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-paren, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional { color: var(--highlight-operator-color) !important; font-weight: normal; padding: 0 2px; } -.rst-content dl:not(.docutils) .optional { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional { font-style: italic; } -.rst-content dl:not(.docutils) .sig-param, -.rst-content dl:not(.docutils).class dt > em, -.rst-content dl:not(.docutils).function dt > em, -.rst-content dl:not(.docutils).method dt > em { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > em, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > em { color: var(--code-literal-color); font-style: normal; padding: 0 4px; } -.rst-content dl:not(.docutils) .sig-param, -.rst-content dl:not(.docutils).class dt > .optional ~ em, -.rst-content dl:not(.docutils).function dt > .optional ~ em, -.rst-content dl:not(.docutils).method dt > .optional ~ em { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k { + font-style: normal; +} +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > .optional ~ em, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > .optional ~ em, +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > .optional ~ em { color: var(--highlight-number-color); font-style: italic; } -.rst-content dl:not(.docutils).class dt > em.property { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em.property { color: var(--highlight-keyword-color); } -.rst-content dl:not(.docutils) dt a.headerlink { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink { color: var(--link-color) !important; } -.rst-content dl:not(.docutils) dt a.headerlink:visited { +html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink:visited { color: var(--link-color-visited); } +html.writer-html5 .rst-content dl.field-list > dd strong { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace; +} footer, #search-results .context {