1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/* Use different background color for C++ and Python code blocks. */
.highlight-pycon .highlight, .highlight-python .highlight {
background: #fcfcce;
}
.highlight-cpp .highlight {
background: #e2ffef;
}
/* adjust highlighted lines */
.highlight-python .highlight .hll {
background: #fff0aa; /* original #ffffcc */
}
.highlight-cpp .highlight .cpf { /* e.g. <cassert> */
color: #108080 /* original #408090 is too similar to our background */
}
.highlight-cpp .highlight .s { /* "strings" */
color: #107090 /* original #4070a0 */
}
.highlight-cpp .highlight .mi,
.highlight-cpp .highlight .mf { /* integers and floats */
color: #008040 /* original #208050 */
}
/* In dark mode, instead of changing bg color we add Python logo */
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) .highlight-pycon,
body:not([data-theme="light"]) .highlight-python,
body:not([data-theme="light"]) .highlight-cpp {
position: relative;
}
body:not([data-theme="light"]) .highlight-pycon::after,
body:not([data-theme="light"]) .highlight-python::after,
body:not([data-theme="light"]) .highlight-cpp::after {
content: "";
background-size: contain;
background-repeat: no-repeat;
width: 24px;
height: 24px;
position: absolute;
top: 5px; /* from the top edge */
right: 5px; /* from the right edge */
pointer-events: none; /* no interactions */
}
body:not([data-theme="light"]) .highlight-pycon::after,
body:not([data-theme="light"]) .highlight-python::after {
background-image: url("../_static/py.png");
opacity: 0.5;
}
body:not([data-theme="light"]) .highlight-cpp::after {
background-image: url("../_static/cpp.png");
opacity: 0.6;
}
}
/* roles used in mol.rst */
.orange-fg { color:#d50; }
.blue-bg { background-color:#ace; }
/* roles used in cif.rst */
.orange-bg { background-color:#fc8; }
.yellow-bg { background-color:#ffa; }
.cyan-bg { background-color:#aff; }
.greenish-bg { background-color:#bd8; }
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) .blue-bg { background-color:#138; }
body:not([data-theme="light"]) .orange-bg { background-color:#950; }
body:not([data-theme="light"]) .yellow-bg { background-color:#660; }
body:not([data-theme="light"]) .cyan-bg { background-color:#055; }
body:not([data-theme="light"]) .greenish-bg { background-color:#350; }
}
/* customize sphinx-inline-tabs to avoid changes of tab-set width */
.tab-set {
display: grid;
grid-template-columns: auto 1fr; /* could be: repeat(auto-fit, auto)*/
}
.tab-set > label {
width: max-content; /* Make label only as wide as its content */
grid-row: 1;
grid-column: auto;
white-space: nowrap;
}
.tab-content {
display: block;
grid-row: 2;
grid-column: 1 / -1; /* Content spans across all columns */
visibility: hidden;
opacity: 0;
transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.tab-set > input:checked + label + .tab-content {
visibility: visible;
opacity: 1;
}
|