4 * Copyright (c) 2004 David Holroyd, and contributors
5 * See the file 'COPYING' for terms of use
7 * Part of the Docbook-CSS stylesheet
8 * http://www.badgers-in-foil.co.uk/projects/docbook-css/
12 * CSS2 styling for DocBook XML
14 * To be included in the cascade _after_ core.css. Defines styling that can't
15 * be generated mechanically from another source.
21 * - do I remember correctly that <abstract> be hidden for screen media?
29 font-family:sans-serif;
37 * Sectioning elements that may contain paragraph-level elements get left/right
40 section>*, chapter>*, bibliography>*, appendix>*, glossary>*, preface>*,
41 dedication>*, colophon>*, sect1>*, sect2>*, sect3>*, sect4>*, sect5>*,
48 * Give admonitions bigger margins, to set them more apart from the main
51 warning, caution, important, tip, note {
57 * Remove any margin defined be the previous rule when the child in question
58 * is a section or title. Titles should be allowed to take up the maximum
59 * available width, as they're usually is larger type. Sections must not
60 * be given margins because, the *contents* of the section will alreay have
61 * them; we don't want to recursively increase margins with the nesting depth
64 section, title, sect1, sect2, sect3, sect4, sect5, bibliodiv {
69 book>title, article>title {
72 border-bottom-style:solid;
75 appendix>title, bibliography>title, chapter>title, colophon>title, dedication>title, glossary>title, part>title, preface>title {
80 section>title, sect1>title, bibliodiv>title {
84 section>section>title, sect2>title {
89 section>section>section>title, sect3>title {
94 section>section>section>section>title, sect4>title {
99 section>section>section>section>section>title, sect5>title {
104 biblioentry > title {
108 /* Give vertical spacing between compoments of the document */
110 *+section, *+chapter, *+bibliography, *+bibliodiv, *+appendix, *+glossary {
116 section>section>*+section {
122 * Give paragraph-level elements some leading space when they aren't the first
123 * item in their containing block.
125 *+para, *+formalpara, *+blockquote, *+glossentry, *+table, *+variablelist,
126 *+example, *+informalexample, *+programlisting, *+cmdsynopsis,
127 *+orderedlist, *+itemizedlist, *+figure,
128 *>warning, *>caution, *>important, *>tip, *>note {
134 * BiblioEntry blocks need a bit more space, since they may contain multiple
135 * paragraphs, and so need greater-than-paragraph spacing to make it clear
136 * which gap is the end just of a paragraph, and which gap is the end of the
144 * REVISIT: I think this is the proper way; but deson't work in Firefox 0.8
150 * Make all children of formalpara inline, instead...
157 formalpara > title:after {
170 content: close-quote;
178 question>para, answer>para {
182 /* see language specific files for content */
195 emphasis[role="strong"] {
198 emphasis[role="bold"] {
202 emphasis[role="underline"] {
203 text-decoration:underline;
206 emphasis[role="strikethrough"] {
207 text-decoration:line-through;
214 foreignphrase, wordasword, productname {
222 sgmltag[class="starttag"]:before, sgmltag[class="emptytag"]:before {
226 sgmltag[class="starttag"]:after, sgmltag[class="endtag"]:after {
230 sgmltag[class="endtag"]:before {
234 sgmltag[class="emptytag"]:after {
238 sgmltag[class="attvalue"]:before, sgmltag[class="attvalue"]:after {
242 sgmltag[class="genentity"]:before {
245 sgmltag[class="genentity"]:after {
249 sgmltag[class="sgmlcomment"]:before {
252 sgmltag[class="sgmlcomment"]:after {
256 sgmltag[class="xmlpi"]:before {
259 sgmltag[class="xmlpi"]:after {
264 application, keycap, guimenu, guimenuitem, guisubmenu {
265 font-family: sans-serif;
269 * ensure there's some whitespace between elements of an author's name
271 author>* + *:before {
275 /* give keycaps a '3D' shaded look */
280 border-top-width: 2px;
281 border-left-width: 3px;
282 border-right-width: 3px;
283 border-bottom-width: 4px;
284 border-top-color: #eeeecc;
285 border-left-color: #eeeecc;
286 border-right-color: #999977;
287 border-bottom-color: #999977;
288 background-color: #ddddbb;
289 /* All these borders may interfere with text on the line bellow. Make
290 the text a little smaller to try and 'pull up' the bottom edge, */
294 keycombo>keycap+keycap:before {
295 /* FIXME: this appears inside the second keycap's 3D boarder, but
296 * ideally, we'd like it to appear inbetween the two keycaps */
300 menuchoice>guimenu+guimenuitem:before,
301 menuchoice>guimenuitem+guimenuitem:before,
302 menuchoice>guimenuitem+guisubmenu:before {
304 /* a 'proper' left-arrow character */
309 border: 2px outset #dddddd;
310 background-color: #dddddd;
313 border-top-color: #eeeeee;
314 border-left-color: #eeeeee;
315 border-right-color: #999999;
316 border-bottom-color: #999999;
317 background-color: #dddddd;
321 /* render link-like elements per HTML's normal styling */
323 /* When ulink contains no body text, the url should be rendered
324 * at this point in the document. Can't see how to do this with CSS */
326 text-decoration:underline;
330 content: " <" attr(url) ">";
348 /* simple symbol - content: "#" attr(linkend);*/
349 /* 'section' symbol */
350 content: "\00a7" attr(linkend);
352 text-decoration: underline;
360 blockquote>attribution {
364 blockquote>attribution:after {
365 /* I've tried various things to position the attribution after the
366 * other blockquote content (e.g. relative/absolute positioning), but
367 * none of the things I tried produced satisfactory results (e.g. the
368 * attribution appears at the bottom of the containing block, but it
369 * overlaps preceeding content). */
372 blockquote>para:before {
375 blockquote>para:after {
376 content: no-close-quote;
378 blockquote>para:last-child:after {
379 content: close-quote;
386 list-style-type: disc;
393 /* 2 deep nested lists */
394 itemizedlist itemizedlist {
395 list-style-type: circle;
398 /* 3 or more deep nested lists */
399 itemizedlist itemizedlist itemizedlist {
400 list-style-type: square;
404 itemizedlist>listitem {
410 list-style-type: decimal;
413 orderedlist>listitem {
418 * We've got no way of properly implementing call-out lists with CSS, so just
419 * present as a list of bullet points.
423 list-style-type: disc;
425 calloutlist>callout {
432 * The list of possible mark names is not defined by Docbook, but "opencircle"
433 * and "bullet" are used in T.D.G. example
435 itemizedlist[mark="opencircle"], listitem[override="opencircle"] {
436 list-style-type: circle;
439 itemizedlist[mark="bullet"], listitem[override="bullet"] {
440 list-style-type: disc;
444 varlistentry>listitem {
447 varlistentry+varlistentry {
451 simplelist[type=horiz] {
455 simplelist[type=inline]>member+member:before {
456 /* typically, we end up with unwanted whitespace before the comma
457 * (i.e. whitespace between <member> elements). I see no way of
458 * suppressing this with CSS.
459 * TODO: try a combination of :after and :first-child instead to
460 * avoid the above issue */
464 cmdsynopsis, code, command, computeroutput, envar, filename, keycode, keysym,
465 literal, option, parameter, sgmltag, systemitem {
466 font-family: monospace;
469 filename[class=directory]:after {
473 /* TODO: Are these specific to 'en' locales or not? */
477 trademark[class="copyright"]:after {
480 trademark[class="registered"]:after {
483 trademark[class="service"]:after {
487 example, informalexample, programlisting {
488 background-color:#dddddd;
490 border: 1px dashed black;
494 example programlisting, informalexample programlisting {
495 background-color: none;
502 warning, caution, tip, note, important {
503 border: 1px dashed gray;
507 /* Have admonition titles appear inline with generated content ("Note:" etc.) */
508 warning>title, caution>title, tip>title, note>title, important>title {
513 warning:before, caution:before, tip:before, note:before, important:before {
514 /* Match the style of <title> */
516 font-family: sans-serif;
519 /* FIXME: background colours are cheezy :S ... */
520 /* see language specific css for content: */
522 background-color: red;
525 background-color: yellow;
528 background-color: #aaaddd;
531 background-color: #dddddd;
534 background-color: plum;
539 thead > row > entry {
540 /* FIXME: will under-rule every row in the <thead>, not just the last
541 * (I tried adding this style to <thead> itself, but this doesn't
542 * appear to work in combination with display:table-header-group, as
543 * defined in tables.css) */
544 border-bottom: 2px solid black;
560 * Attempt to display footnotes on-mouseover. This may well break if a
561 * footnote element has multiple children (I think the children will end up
562 * stacked on top of each other).
578 border: 2px dotted black;
579 background-color: #ffeeaa;
586 background-color: #ffeeaa;
587 border: 2px dotted black;
594 Attempting to format <footnote> as a sitebar, floating it to the right.
595 Sometimes works for footnotes in the 'main body' of some text, but works badly
596 when the containing block is, for instance, a table cell.
601 border: 2px dotted black;
607 border: 2px dotted black;
614 content: "*Footnote";
617 font-family: sans-serif;
621 glossentry>glossterm {
639 mediaobject>textobject {