HTML5: Place code-block line numbers in pseudo-elements.
[docutils.git] / docutils / docutils / writers / html5_polyglot / minimal.css
blob192108ffaca01fc3f671ed2f5a25d66e900bdec9
1 /* Minimal style sheet for the HTML output of Docutils. */
2 /* */
3 /* :Author: Günter Milde, based on html4css1.css by David Goodger */
4 /* :Id: $Id$ */
5 /* :Copyright: © 2015 Günter Milde. */
6 /* :License: Released under the terms of the `2-Clause BSD license`_, */
7 /* in short: */
8 /* */
9 /* Copying and distribution of this file, with or without modification, */
10 /* are permitted in any medium without royalty provided the copyright */
11 /* notice and this notice are preserved. */
12 /* */
13 /* This file is offered as-is, without any warranty. */
14 /* */
15 /* .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause */
17 /* This CSS2.1_ stylesheet defines rules for Docutils elements without */
18 /* HTML equivalent. It is required to make the document semantic visible. */
19 /* */
20 /* .. _CSS2.1: http://www.w3.org/TR/CSS2 */
21 /* .. _validates: http://jigsaw.w3.org/css-validator/validator$link */
23 /* titles */
24 p.topic-title,
25 p.admonition-title,
26 p.system-message-title {
27 font-weight: bold;
29 p.sidebar-title,
30 p.rubric {
31 font-weight: bold;
32 font-size: larger;
34 p.rubric {
35 color: maroon;
37 p.subtitle,
38 p.section-subtitle,
39 p.sidebar-subtitle {
40 font-weight: bold;
41 margin-top: -0.5em;
43 h1 + p.subtitle {
44 font-size: 1.6em;
46 h2 + p.section-subtitle, a.toc-backref {
47 color: black;
48 text-decoration: none;
51 /* Warnings, Errors */
52 .system-messages h2,
53 .system-message-title,
54 span.problematic {
55 color: red;
58 /* Inline Literals */
59 .docutils.literal {
60 font-family: monospace;
61 white-space: pre-wrap;
63 /* do not wrap at hyphens and similar: */
64 .literal > span.pre { white-space: nowrap; }
66 /* Lists */
68 /* compact and simple lists: no margin between items */
69 .simple li, .simple ul, .simple ol,
70 .compact li, .compact ul, .compact ol,
71 .simple > li p, dl.simple > dd,
72 .compact > li p, dl.compact > dd {
73 margin-top: 0;
74 margin-bottom: 0;
76 /* Nested Paragraphs */
77 p:first-child { margin-top: 0; }
78 p:last-child { margin-bottom: 0; }
79 td > p, th > p { margin-bottom: 0; }
81 /* Table of Contents */
82 .topic.contents { margin: 0.5em 0; }
83 .topic.contents ul {
84 list-style-type: none;
85 padding-left: 1.5em;
88 /* Enumerated Lists */
89 ol.arabic { list-style: decimal }
90 ol.loweralpha { list-style: lower-alpha }
91 ol.upperalpha { list-style: upper-alpha }
92 ol.lowerroman { list-style: lower-roman }
93 ol.upperroman { list-style: upper-roman }
95 /* Definition Lists and Derivatives */
96 dt .classifier { font-style: italic }
97 dt .classifier:before {
98 font-style: normal;
99 margin: 0.5em;
100 content: ":";
102 /* Field Lists and similar */
103 /* bold field name, content starts on the same line */
104 dl.field-list > dt,
105 dl.option-list > dt,
106 dl.docinfo > dt,
107 dl.footnote > dt,
108 dl.citation > dt {
109 font-weight: bold;
110 clear: left;
111 float: left;
112 margin: 0;
113 padding: 0;
114 padding-right: 0.5em;
116 /* Offset for field content (corresponds to the --field-name-limit option) */
117 dl.field-list > dd,
118 dl.option-list > dd,
119 dl.docinfo > dd {
120 margin-left: 9em; /* ca. 14 chars in the test examples, fit all Docinfo fields */
122 /* start field-body on a new line after long field names */
123 dl.field-list > dd > *:first-child,
124 dl.option-list > dd > *:first-child
126 display: inline-block;
127 width: 100%;
128 margin: 0;
130 /* field names followed by a colon */
131 dl.field-list > dt:after,
132 dl.docinfo > dt:after {
133 content: ":";
136 /* Bibliographic Fields (docinfo) */
137 dl.docinfo pre.address {
138 font: inherit;
139 margin: 0.5em 0;
141 dl.docinfo > dd.authors > p { margin: 0; }
143 /* Option Lists */
144 dl.option-list > dt { font-weight: normal; }
145 span.option { white-space: nowrap; }
147 /* Footnotes and Citations */
148 dl.footnote.superscript > dd { margin-left: 1em; }
149 dl.footnote.brackets > dd { margin-left: 2em; }
150 dl.footnote > dt { font-weight: normal; }
151 a.footnote-reference.brackets:before,
152 dt.label > span.brackets:before { content: "["; }
153 a.footnote-reference.brackets:after,
154 dt.label > span.brackets:after { content: "]"; }
155 a.footnote-reference.superscript,
156 dl.footnote.superscript > dt.label {
157 vertical-align: super;
158 font-size: small;
160 dt.label > span.fn-backref {
161 margin-left: 0.2em;
162 font-weight: normal;
164 dt.label > span.fn-backref > a { font-style: italic; }
166 /* Alignment */
167 .align-left {
168 text-align: left;
169 margin-right: auto;
171 .align-center {
172 clear: both;
173 text-align: center;
174 margin-left: auto;
175 margin-right: auto;
177 .align-right {
178 text-align: right;
179 margin-left: auto;
181 .align-top { vertical-align: top; }
182 .align-middle { vertical-align: middle; }
183 .align-bottom { vertical-align: bottom; }
185 /* reset inner alignment in figures and tables */
186 figure.align-left, figure.align-right,
187 table.align-left, table.align-center, table.align-right {
188 text-align: inherit;
191 /* Text Blocks */
192 blockquote,
193 div.topic,
194 aside.topic {
195 margin: 1em 2em;
197 .sidebar,
198 .admonition,
199 .system-message {
200 border: thin solid;
201 margin: 1em 2em;
202 padding: 0.5em 1em;
204 .sidebar {
205 width: 30%;
206 max-width: 26em;
207 float: right;
208 clear: right;
210 div.line-block { display: block; }
211 div.line-block div.line-block, pre { margin-left: 2em; }
213 /* Code line numbers: dropped when copying text from the page */
214 pre.code .ln { display: none; }
215 pre.code code:before {
216 content: attr(data-lineno); /* …, none) fallback not supported by any browser */
217 color: gray;
220 /* Tables */
221 table {
222 border-collapse: collapse;
224 td, th {
225 border: thin solid silver;
226 padding: 0 1ex;
228 .borderless td, .borderless th {
229 border: 0;
230 padding: 0;
231 padding-right: 0.5em /* separate table cells */
234 table > caption {
235 text-align: left;
236 margin-top: 0.2em;
237 margin-bottom: 0.2em;
239 table.captionbelow {
240 caption-side: bottom;
243 /* Document Header and Footer */
244 header { border-bottom: 1px solid black; }
245 footer { border-top: 1px solid black; }
247 /* Images are block-level by default in Docutils */
248 /* New HTML5 block elements: set display for older browsers */
249 img, header, section, footer, aside, nav, main, article, figure, video {
250 display: block;
252 /* inline images */
253 p img, p video, figure img, figure video {
254 display: inline;