All Downloads are FREE. Search and download functionalities are using the official Maven repository.

css.dedicon-default.scss Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
/**********************************************************************************
 * Dedicon Default CSS
 * http://www.dedicon.nl/
 *
 * Author: Davy Kager 
 * Author: Bert Frees 
 *
 * See also Braille CSS: http://snaekobbi.github.io/braille-css-spec/master/index.html
 */

/**********************************************************************************
 * General rules
 */

/* --------------------------------------------------------------------------------
 * Namespaces
 */
@namespace xml "http://www.w3.org/XML/1998/namespace";

/* --------------------------------------------------------------------------------
 * Page layout
 *
 * A page contains 33 columns by 28 rows of braille (configurable with options, defaults in script).
 *
 * The print page number is shown in the top-center.
 * If a braille page contains content from multiple print pages,
 * the print page number is a range "from - to".
 * If no print page number is available, this part of the braille page is left blank.
 *
 * The braille page number is shown in the top-right.
 *
 * See also the pagenum rule.
 */
@if $show-print-page-numbers {
	@page {
		@top-center {
			content: string(print-page-from, page-start-except-last) string(print-page-to, page-last);
		}
	}
}
@if $show-braille-page-numbers {
	@page {
		@top-right {
			content: counter(page);
		}
	}
}

/* --------------------------------------------------------------------------------
 * Boilerplate
 *
 * Each volume begins with the volume-level TOC.
 */
@volume {
	@begin {
		/* The volume-toc flow is defined by the system default CSS. */
		content: flow(title-page) flow(volume-toc);
	}
}

/* --------------------------------------------------------------------------------
 * Hidden elements
 *
 * These are not directly incldued in the output.
 *
 * See also the #generated-doctitle and #generated-docauthors rules.
 */
head, doctitle, docauthor {
	display: none;
}

/**********************************************************************************
 * Block elements
 */

/* --------------------------------------------------------------------------------
 * Print page numbers
 *
 * For SV books, if there is a print page change somewhere on the braille page,
 * the new print page number is shown on its own line, horizontally centered,
 * with a blank line before and after it.
 *
 * See also the @page rule.
 */
pagenum {
	display: none;
	/* The following lines sets the values used for the top-center page position and the TOC. */
	string-set: print-page-from content() ' - ', print-page-to content(), print-page-toc content() '\A0\A0';
}
@if $show-inline-print-page-numbers {
	pagenum {
		display: block;
		margin-top: 1;
		margin-bottom: 1;
		text-align: center;
	}
	/* HACK: don't show pagenums if they are the first thing on the page. */
	level1 > pagenum:first-child {
		display: none;
	}
} /* $show-inline-print-page-numbers */
@else {
	pagenum {
		display: none;
	}
}

/* --------------------------------------------------------------------------------
 * Front matter, body matter and rear matter
 *
 * The print page number is reset on the start of these elements.
 *
 * If any of these consist of only content that is not rendered,
 * then that element as a whole is not rendered.
 */
frontmatter, bodymatter, rearmatter {
	display: block;
	/* The following line sets the values used for the top-center page position and the TOC. */
	string-set: print-page-from '', print-page-to '';
}
frontmatter:not(:has(> *:not(doctitle, docauthor, #generated-title-page))) {
	display: none;
}

/* --------------------------------------------------------------------------------
 * Levels (sections)
 *
 * Level 1 always start on a new page.
 * Level 2 has two blank lines before it.
 * Other levels have one blank line before them.
 *
 * See also the heading rules.
 */
level,
level1, level2, level3,
level4, level5, level6 {
	display: block;
}
level1 {
	page-break-before: always;
}
level2 {
	margin-top: 2;
}
level, level3,
level4, level5, level6 {
	margin-top: 1;
}

/* --------------------------------------------------------------------------------
 * Headings
 *
 * A heading cannot be the last item on a page.
 * If the heading spans multiple braille lines,
 * every line except the first one is indented by 2 braille cells.
 *
 * Heading level 1 has a blank line after it,
 * and typically starts on a new page because it is at the start of a level 1.
 * Other headings have no blank lines after them.
 *
 * See also the level rules.
 */
hd, h1, h2, h3, h4, h5, h6 {
	display: block;
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
	page-break-after: avoid;
}
h1 {
	margin-bottom: 1;
}

/* --------------------------------------------------------------------------------
 * Divisions
 */
div {
	display: block;
}

/* --------------------------------------------------------------------------------
 * Paragraphs
 *
 * A paragraph is a block element with no special features.
 *
 * An empty paragraph is rendered as a blank line.
 *
 * To precede the paragraph by a blank line, add class precedingemptyline.
 * To indent the first line of the paragraph, add class indented.
 * To mark this paragraph as a table title or caption, add class table-title.
 */
p {
	display: block;
}
p:empty {
	margin-bottom: 1;
}

/* --------------------------------------------------------------------------------
 * Generated title page
 */
#generated-title-page {
	flow: title-page;
	page-break-inside: avoid;
}

/* --------------------------------------------------------------------------------
 * Book title, author and ISBN
 */
#generated-doctitle,
#generated-docauthors,
#generated-isbn {
	margin-top: 1;
	margin-bottom: 2;
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
}

#generated-title-page-footer {
	-obfl-vertical-position: 24;
}

/* --------------------------------------------------------------------------------
 * Generated colophon page
 */
#generated-colophon-page {
	page-break-inside: avoid;
}

/* --------------------------------------------------------------------------------
 * Lists
 *
 * Two consecutive lists are separated by a blank line.
 */
list {
	display: block;
}
list:has(+ list)::after {
	/* Setting a margin doesn't seem to work for lists. */
	white-space: pre-line;
	/* \A is a line break. */
	content: '\A';
}

/* --------------------------------------------------------------------------------
 * List items
 *
 * If the list item spans multiple braille lines,
 * every line except the first one is indented by 2 braille cells.
 */
list > li {
	display: block;
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
}

/* --------------------------------------------------------------------------------
 * Volume-level TOC
 *
 * The TOC always starts on a new page.
 */
#generated-volume-toc::-obfl-on-toc-start {
	display: block;
	page-break-before: always;
	margin-bottom: 1;
	content: 'Inhoud band ' -obfl-evaluate('(round $volume)');
}

/* --------------------------------------------------------------------------------
 * TOC items
 *
 * If the TOC item spans multiple braille lines,
 * every line except the first one is indented by 2 braille cells.
 *
 * See also the pagenum rule.
 */
#generated-volume-toc li > a::after {
	/* Whitespace after the print page number is added through string-set. */
	/* \A0 is a non-breaking space. */
	content: '\A0\A0' target-string(attr(href), print-page-toc) target-counter(attr(href), page);
}
#generated-volume-toc li > a {
	display: block;
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
}
#generated-volume-toc li {
	/* Override default list item behavior to avoid indenting nested lists. */
	margin-left: 0;
	text-indent: 0;
}

/* --------------------------------------------------------------------------------
 * Producer notes
 *
 * This adds the text "ND:", followed by a space and the element text.
 */
prodnote::before {
	content: 'ND: ';
}
prodnote {
	display: block;
}

/* --------------------------------------------------------------------------------
 * Tables
 *
 * The start of a table is indicated by the text "bt".
 * The end of a table is indicated by the text "et".
 * A table has a blank line before and after it.
 */
table::before {
	display: block;
	content: 'bt';
}
table::after {
	display: block;
	content: 'et';
}
table {
	display: block;
	margin-top: 1;
	margin-bottom: 1;
}

/* --------------------------------------------------------------------------------
 * Table rows
 *
 * Each row is shown on a new line.
 * If the row spans multiple braille lines,
 * every line except the first one is indented by 2 braille cells.
 */
table > tr {
	display: block;
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
}

/* --------------------------------------------------------------------------------
 * Table columns
 *
 * Columns are separated by a semicolon and a space.
 */
table > tr > td:has(+ td)::after {
	/* Use a braille pattern here because a semicolon currently doesn't work. */
	content: '⠆⠀';
}

/* --------------------------------------------------------------------------------
 * Table cells
 *
 * Empty table cells are indicated by the text "gg".
 */
table > tr > td:empty::before {
	content: 'gg';
}

/* --------------------------------------------------------------------------------
 * Image groups
 *
 * The start of an image group is indicated by the text "ba".
 * The end of an image group is indicated by the text "ea".
 * An image group has a blank line before and after it.
 */
imggroup::before {
	display: block;
	content: 'ba';
}
imggroup::after {
	display: block;
	content: 'ea';
}
imggroup {
	display: block;
	margin-top: 1;
	margin-bottom: 1;
}

/* --------------------------------------------------------------------------------
 * Captions
 *
 * This adds the text "Bijschrift:", followed by a space and the element text.
 * Captions are only used for images.
 */
caption::before {
	content: 'Bijschrift: ';
}
caption {
	display: block;
}

/* --------------------------------------------------------------------------------
 * Sidebarss
 *
 * The start of a sidebar is indicated by the text "bk".
 * The end of a sidebar is indicated by the text "ek".
 * A sidebar has a blank line before and after it.
 *
 * The value of the render attribute has no effect on the output.
 */
sidebar::before {
	display: block;
	content: 'bk';
}
sidebar::after {
	display: block;
	content: 'ek';
}
sidebar {
	display: block;
	margin-top: 1;
	margin-bottom: 1;
}

/* --------------------------------------------------------------------------------
 * Poems
 *
 * A poem has a blank line before and after it.
 */
poem {
	display: block;
	margin-top: 1;
	margin-bottom: 1;
}

/* --------------------------------------------------------------------------------
 * Linegroups
 */
linegroup {
	display: block;
}

/* --------------------------------------------------------------------------------
 * Lines
 *
 * If a line spans multiple braille lines,
 * every line except the first one is indented by 2 braille cells.
 *
 * A line should be kept on a single page.
 */
line {
	display: block;
	page-break-inside: avoid;
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
}

/* --------------------------------------------------------------------------------
 * Notes
 *
 * A note is indicated with an asterisk (*), but not with its number.
 *
 * Every line except the first one is indented by 2 braille cells.
 * The first line is indented by 1 braille cell,
 * this extra cell contains the asterisk.
 *
 * A note has a blank line before and after it.
 *
 * Notes are inserted inside the block element that references it,
 * after all the block's other content.
 * Because of this behavior, some styling from these blocks has to be reset.
 */
note {
	display: block;
	margin-top: 1;
	margin-bottom: 1;
	margin-left: 2;
}
note > :first-child::before {
	content: '⠔';
}
note > :first-child {
	text-indent: -1;
}
note > :not(:first-child) {
	text-indent: 0;
}

/* --------------------------------------------------------------------------------
 * Definition lists
 */
dl {
	display: block;
}

/* --------------------------------------------------------------------------------
 * Definition list terms
 */
dt {
	display: block;
}

/* --------------------------------------------------------------------------------
 * Definition list definitions
 *
 * Definitions are indented by 2 braille cells.
 */
dd {
	display: block;
	margin-left: 2;
}

/* --------------------------------------------------------------------------------
 * Code
 *
 * Code is not hyphenated.
 * To also preserve whitespace, add attribute xml:space="preserve" to the XML element.
 */
code {
	display: block;
	hyphens: none;
}

/**********************************************************************************
 * Inline elements
 */

/* --------------------------------------------------------------------------------
 * Line breaks
 */
br::before {
	white-space: pre-line;
	/* \A is a line break. */
	content: '\A';
}

/* --------------------------------------------------------------------------------
 * Subscript
 *
 * Subscript is indicated with dots 16.
 */
sub::before {
	content: '⠡';
}

/* --------------------------------------------------------------------------------
 * Superscript
 *
 * Superscript is indicated with dots 34.
 */
sup::before {
	content: '⠌';
}

/* --------------------------------------------------------------------------------
 * Note references
 *
 * A note reference is indicated by an asterisk (*).
 */
noteref::before {
	content: '⠔';
}
 
/* --------------------------------------------------------------------------------
 * Current volume number
 */
.placeholder-current-volume::after {
	content: -obfl-evaluate('(round $volume)');
}

/* --------------------------------------------------------------------------------
 * Total number of volumes
 */
.placeholder-total-volumes::after {
	content: -obfl-evaluate('(round $volumes)');
}

/**********************************************************************************
 * Attributes
 *
 * These are attributes that can be specified on XML elements.
 */
 
 /* --------------------------------------------------------------------------------
 * Strong text
 *
 * This is marked up as bold.
 */
.emph-bxx-brl {
	text-transform: louis-bold;
}

/* --------------------------------------------------------------------------------
 * Emphasized text
 *
 * This is marked up as italic.
 */
.emph-xix-brl {
	text-transform: louis-ital;
}

/* --------------------------------------------------------------------------------
 * Preceding empty line
 *
 * Adds a blank line before the element.
 */
.precedingemptyline::before {
	/* The next line prevents newline characters from being converted to spaces. */
	white-space: pre-line;
	/* \A is a line break. */
	content: '\A';
}

/* --------------------------------------------------------------------------------
 * Indented elements
 *
 * Indents the element by 2 braille cells.
 */
.indented {
	text-indent: 2;
}

/* --------------------------------------------------------------------------------
 * Table title or caption
 *
 * This adds the text "titel tabel", followed by the element text on a new line.
 * The element text is indented by 2 braille cells.
 */
p.table-title::before {
	/* The next line prevents newline characters from being converted to spaces. */
	white-space: pre-line;
	/* \A is a line break. */
	content: 'tabel titel\A';
}
p.table-title {
	/* This needs a left margin in order to negatively indent the first line. */
	margin-left: 2;
	text-indent: -2;
}

/* --------------------------------------------------------------------------------
 * xml:space="preserve"
 *
 * Elements with this attribute and value are treated as preformatted text.
 */
[xml|space=preserve] {
	white-space: pre-wrap;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy