xref: /linux/Documentation/sphinx-static/custom.css (revision d7758384ccb470aed7c7a86f0825b1b16bd7a288)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * CSS tweaks for the Alabaster theme
4 */
5
6div.body {  max-width: 120em; }
7
8/* Shrink the headers a bit */
9div.body h1 { font-size: 180%; }
10div.body h2 { font-size: 150%; }
11div.body h3 { font-size: 130%; }
12div.body h4 { font-size: 110%; }
13
14/* toctree captions are styled like h2 */
15div.toctree-wrapper p.caption[role=heading] { font-size: 150%; }
16
17/* Tighten up the layout slightly */
18div.body { padding: 0 15px 0 10px; }
19div.sphinxsidebarwrapper { padding: 1em 0.4em; }
20div.sphinxsidebar { font-size: inherit;
21		    max-height: 100%;
22		    overflow-y: auto; }
23/* Tweak document margins and don't force width */
24div.document {
25    margin: 20px 10px 0 10px;
26    width: auto;
27}
28
29/* Size the logo appropriately */
30img.logo {
31    width: 104px;
32    margin-bottom: 20px;
33}
34
35/* The default is to use -1em, which makes it override text */
36li { text-indent: 0em; }
37
38/*
39 * Parameters for the display of function prototypes and such included
40 * from C source files.
41 */
42dl.function, dl.struct, dl.enum { margin-top: 2em; background-color: #ecf0f3; }
43/* indent lines 2+ of multi-line function prototypes */
44dl.function dt { margin-left: 10em; text-indent: -10em; }
45/*
46 * Preserve C API signatures on one line and apply contained horizontal
47 * scrolling to prevent them from exceeding their container width and
48 * breaking page layout.
49 */
50dl.c { overflow-x: auto; overflow-y: hidden; }
51dl.c > dt.sig.sig-object { white-space: nowrap; }
52dt.sig-object { font-size: larger; }
53div.kernelindent { margin-left: 2em; margin-right: 4em; }
54
55/*
56 * Parameters for the display of function prototypes and such included
57 * from Python source files.
58 */
59dl.py { margin-top: 2em; background-color: #ecf0f3; }
60dl.py.class { margin-left: 2em; text-indent: -2em; padding-left: 2em; }
61dl.py.method, dl.py.attribute { margin-left: 2em; text-indent: -2em; }
62dl.py li, pre { text-indent: 0em; padding-left: 0 !important; }
63
64/*
65 * Tweaks for our local TOC
66 */
67div.kerneltoc li.toctree-l1 { font-size: smaller;
68		text-indent: -1em;
69		margin-left: 1em; }
70div.kerneltoc li.current > a {font-weight: bold; }
71div.kerneltoc li.toctree-l2,li.toctree-l3 { font-size: small;
72		text-indent: -1em;
73		margin-left: 1em;
74		list-style-type: none;
75	      }
76div.kerneltoc li.current ul { margin-left: 0; }
77div.kerneltoc { background-color: #eeeeee; }
78div.kerneltoc li.current ul { background-color: white; }
79
80/*
81 * The CSS magic to toggle the contents on small screens.
82 */
83label.kernel-toc-title { display: none; }
84label.kernel-toc-title:after {
85    content: "[Hide]";
86}
87input[type=checkbox]:checked ~ label.kernel-toc-title:after {
88    content: "[Show]";
89}
90/* Hide the toggle on large screens */
91input.kernel-toc-toggle { display: none; }
92
93/*
94 * Show and implement the toggle on small screens.
95 * The 875px width seems to be wired into alabaster.
96 */
97@media screen and (max-width: 875px) {
98    label.kernel-toc-title { display: inline;
99			     font-weight: bold;
100			     font-size: larger; }
101    input[type=checkbox]:checked ~ div.kerneltoc {
102	display: none;
103    }
104    h3.kernel-toc-contents { display: inline; }
105    div.kerneltoc a { color: black; }
106}
107
108/* Language selection menu */
109
110div.admonition {
111    /*
112     * Make sure we don't overlap notes and warnings at the top of the
113     * document.
114     */
115    clear: both;
116}
117
118div.language-selection {
119    background: #eeeeee;
120    border: 1px solid #cccccc;
121    margin-bottom: 1em;
122    padding: .5em;
123
124    position: relative;
125    float: right;
126}
127
128div.language-selection a {
129    display: block;
130    padding: 0.5em;
131    color: #333333;
132    text-decoration: none;
133}
134
135div.language-selection ul {
136    display: none;
137    position: absolute;
138
139    /* Align with the parent div */
140    top: 100%;
141    right: 0;
142    margin: 0;
143
144    list-style: none;
145
146    background: #fafafa;
147    border: 1px solid #cccccc;
148
149    /* Never break menu item lines */
150    white-space: nowrap;
151}
152
153div.language-selection:hover ul {
154    display: block;
155}
156
157div.language-selection ul li:hover {
158    background: #dddddd;
159}
160
161/* Let rendered reference links in tables wrap when needed. */
162div.body table.docutils a.reference {
163    overflow-wrap: anywhere;
164}
165
166/* Let long link text wrap instead of forcing overflow. */
167a {
168    overflow-wrap: anywhere;
169}
170
171/* Make xrefs more universally visible */
172a.reference, a.reference:hover {
173    border-bottom: none;
174    text-decoration: underline;
175    text-underline-offset: 0.3em;
176}
177
178/* Slightly different style for sidebar links */
179div.sphinxsidebar a { border-bottom: none; }
180div.sphinxsidebar a:hover {
181    border-bottom: none;
182    text-decoration: underline;
183    text-underline-offset: 0.3em;
184}
185
186a.manpage {
187	font-style: normal;
188	font-weight: bold;
189	font-family: "Courier New", Courier, monospace;
190}
191