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