Debian Codegraph @

src/pydata_sphinx_theme/assets/styles/content/_api.scss

raw
1 // Style API docs from sphinx' autodoc / autosummary
2
3 /*******************************************************************************
4 * Styling for field lists
5 */
6
7 /* grey highlighting of 'parameter' and 'returns' field */
8 table.field-list {
9 border-collapse: separate;
10 border-spacing: 10px;
11 margin-left: 1px;
12
13 th.field-name {
14 padding: 1px 8px 1px 5px;
15 white-space: nowrap;
16 background-color: var(--pst-color-surface);
17 }
18
19 /* italic font for parameter types */
20 td.field-body {
21 p {
22 font-style: italic;
23
24 > strong {
25 font-style: normal;
26 }
27 }
28
29 /* reduced space around parameter description */
30 blockquote {
31 border-left: none;
32 margin: 0 0 0.3em;
33 padding-left: 30px;
34 }
35 }
36 }
37
38 /*******************************************************************************
39 * Styling for autosummary tables
40 */
41
42 .table.autosummary {
43 // The first column (with the signature) should not wrap
44 td:first-child {
45 white-space: nowrap;
46 }
47 }
48
49 /* overriding basic.css to use our own monospace font */
50 .sig {
51 font-family: var(--pst-font-family-monospace);
52 }
53
54 /* C++ specific styling - overriding the basic.css to avoid custom colors */
55
56 .sig-inline.c-texpr,
57 .sig-inline.cpp-texpr {
58 font-family: unset;
59 }
60
61 .sig.c .k,
62 .sig.c .kt,
63 .sig.cpp .k,
64 .sig.cpp .kt {
65 color: var(--pst-color-text-base);
66 }
67
68 .sig.c .m,
69 .sig.cpp .m {
70 color: var(--pst-color-text-base);
71 }
72
73 .sig.c .s,
74 .sig.c .sc,
75 .sig.cpp .s,
76 .sig.cpp .sc {
77 color: var(--pst-color-text-base);
78 }
79
80 // addition
81
82 // .sig.c .sig-name .n,
83 // .sig.cpp .sig-name .n {
84 // color: var(--pst-color-inline-code);
85 // }
86
87 .sig-name {
88 color: var(--pst-color-inline-code);
89 }
90
91 .sig-param .o,
92 .sig-param .default_value {
93 color: var(--pst-color-text-muted);
94 font-weight: normal;
95 }
96
97 // change target color for dark theme
98 dt:target,
99 span.highlighted {
100 background-color: var(--pst-color-target);
101 }
102
103 .viewcode-back {
104 font-family: var(--pst-font-family-base);
105 }
106
107 .viewcode-block:target {
108 border-top: 1px solid var(--pst-color-border);
109 border-bottom: 1px solid var(--pst-color-border);
110 position: relative;
111 background-color: var(--pst-color-target);
112 }
113
114 dl > dt > a:has(.viewcode-link) {
115 // Sphinx applies a `float:right` rule to the .viewcode-line span, which
116 // exposes a browser glitch in the focus ring. It seems the browser creates
117 // two separate boxes, an empty box where the anchor element gets laid out and
118 // then another box around the anchor's contents that have been floated right.
119 // Firefox draws the focus ring around the empty anchor element box. Chrome
120 // draws two focus rings: one around the empty anchor and one around the
121 // floated-right element. To fix the glitch, we apply the float rule on the
122 // parent rather than the child.
123 float: right;
124
125 .viewcode-link {
126 float: none;
127 }
128 }
129
130 /*******************************************************************************
131 * Styling for autosummary titles like "parameters" and "returns"
132 */
133
134 // the API selector
135 // from https://github.com/pradyunsg/furo/blob/main/src/furo/assets/styles/content/_api.sass#L6)
136 dl[class]:not(.option-list, .field-list, .footnote, .glossary, .simple) {
137 // increase margin bottom after the dl elements
138 margin-bottom: 3rem;
139
140 dd {
141 margin-left: 2rem;
142
143 // Fix until this will be solved to Sphinx https://github.com/sphinx-doc/sphinx/issues/10815
144 & > dl.simple > dt {
145 display: flex;
146 }
147 }
148
149 dl.field-list {
150 display: grid;
151 grid-template-columns: unset;
152 }
153
154 dt.field-odd,
155 dt.field-even {
156 margin-top: 0.2rem;
157 margin-bottom: 0.1rem;
158 background-color: var(--pst-color-surface);
159 }
160 }