Skip to content

Commit 33318bf

Browse files
gmarullcfriedt
authored andcommitted
doc: css: update code documentation directives style
New Sphinx version (or docutils) has slightly changed the output format for code documentation directives. These changes try to mimic previous behavior, even though it does not achieve 100% equal result. In some cases the new default style does not require further tweaks, and in some others styling as before is not possible. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 3497031 commit 33318bf

File tree

1 file changed

+17
-74
lines changed

1 file changed

+17
-74
lines changed

doc/_static/css/custom.css

Lines changed: 17 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -124,64 +124,27 @@ hr,
124124
border-color: var(--admonition-attention-title-background-color) !important;
125125
color: var(--admonition-attention-color) !important;
126126
}
127-
.rst-content dl:not(.docutils).class dt,
128-
.rst-content dl:not(.docutils).function dt,
129-
.rst-content dl:not(.docutils).method dt,
130-
.rst-content dl:not(.docutils).attribute dt {
131-
width: 100% !important;
132-
}
133-
.rst-content dl:not(.docutils).class > dt,
134-
.rst-content dl:not(.docutils).function > dt,
135-
.rst-content dl:not(.docutils).method > dt,
136-
.rst-content dl:not(.docutils).attribute > dt {
137-
font-size: 100% !important;
138-
font-weight: normal !important;
139-
margin-bottom: 16px !important;
140-
padding: 6px 8px !important;
127+
128+
.rst-content dt.sig .k {
129+
color: var(--highlight-keyword2-color) !important;
130+
font-style: normal !important;
141131
}
142-
.rst-content dl:not(.docutils) tt.descclassname,
143-
.rst-content dl:not(.docutils) code.descclassname {
144-
color: var(--highlight-type2-color) !important;
145-
font-weight: normal !important;
132+
133+
.rst-content dt.sig .kt {
134+
color: var(--highlight-keyword-color) !important;
135+
font-style: normal !important;
146136
}
147-
.rst-content dl:not(.docutils) tt.descname,
148-
.rst-content dl:not(.docutils) code.descname {
137+
138+
.rst-content dt.sig .sig-name .n {
149139
color: var(--highlight-function-color) !important;
150-
font-weight: normal !important;
151140
}
152-
.rst-content dl:not(.docutils) .sig-paren,
153-
.rst-content dl:not(.docutils) .optional {
154-
color: var(--highlight-operator-color) !important;
141+
142+
.rst-content dt.sig .k,
143+
.rst-content dt.sig .kt,
144+
.rst-content dt.sig .n {
155145
font-weight: normal !important;
156-
padding: 0 2px !important;
157-
}
158-
.rst-content dl:not(.docutils) .optional {
159-
font-style: italic !important;
160-
}
161-
.rst-content dl:not(.docutils) .sig-param,
162-
.rst-content dl:not(.docutils).class dt > em,
163-
.rst-content dl:not(.docutils).function dt > em,
164-
.rst-content dl:not(.docutils).method dt > em {
165-
color: var(--code-literal-color) !important;
166-
font-style: normal !important;
167-
padding: 0 4px !important;
168-
}
169-
.rst-content dl:not(.docutils) .sig-param,
170-
.rst-content dl:not(.docutils).class dt > code,
171-
.rst-content dl:not(.docutils).function dt > code,
172-
.rst-content dl:not(.docutils).method dt > code {
173-
padding: 0 4px !important;
174-
}
175-
.rst-content dl:not(.docutils) .sig-param,
176-
.rst-content dl:not(.docutils).class dt > .optional ~ em,
177-
.rst-content dl:not(.docutils).function dt > .optional ~ em,
178-
.rst-content dl:not(.docutils).method dt > .optional ~ em {
179-
color: var(--highlight-number-color) !important;
180-
font-style: italic !important;
181-
}
182-
.rst-content dl:not(.docutils).class dt > em.property {
183-
color: var(--highlight-keyword-color) !important;
184146
}
147+
185148
.rst-content dl:not(.docutils) dt a.headerlink {
186149
color: var(--link-color) !important;
187150
}
@@ -878,41 +841,21 @@ kbd, .kbd {
878841

879842
/* Breathe tweaks */
880843

881-
.rst-content dl.group>dt, .rst-content dl.group>dd>p {
882-
display:none !important;
883-
}
884-
885-
.rst-content dl.group {
886-
margin: 0 0 1rem 0;
887-
}
888-
889-
.rst-content dl.group>dd {
890-
margin-left: 0 !important;
844+
.rst-content .section > dl > dd {
845+
margin-left: 0;
891846
}
892847

893848
.rst-content p.breathe-sectiondef-title {
894849
font-size: 115%;
895850
color: var(--link-color);
896851
}
897852

898-
.rst-content div.breathe-sectiondef {
899-
padding-left: 0 !important;
900-
}
901-
902853
.rst-content dl:not(.docutils) dl:not(.rst-other-versions) dt {
903854
background: var(--admonition-note-background-color) !important;
904855
border-top: none !important;
905856
border-left: none !important;
906857
}
907858

908-
.rst-content dl:not(.docutils).c.var .pre {
909-
padding-right: 4px;
910-
}
911-
912-
.rst-content dl:not(.docutils).c.struct .property {
913-
padding-right: 4px !important;
914-
}
915-
916859
/* Misc tweaks */
917860

918861
.rst-columns {

0 commit comments

Comments
 (0)