Bản mẫu:Bản mẫu mục lục/styles.css

Văn thư lưu trữ mở Wikisource
/*
 * Common and shared styles
 *
 * The classes titles "1-m-1" and similar are used to target general formatting:
 * Any cells before the "m" are considered "chapter numbers", the "m" is the main
 * cell: this is the widest one. Cells after the "m" are pagenumber cells.
 *
 * NOTE: *Only* the most common cases belong here - this style sheet is loaded for
 * every TOC using these templates. Specialised formatting or formatting that
 * applies only to a small number of works should use its own, dedicated CSS.
 */

.wst-toc-table {
	border-collapse: collapse;
	background-color:transparent;
	margin:auto;
	max-width: 100%;
}
 
/* Default cell styles */
.wst-toc-table td {
	vertical-align: top;
}
 
/* First cells (chapter numbers) are aligned right by default */
.__toc_row_1-m-1 td:nth-child(1),
.__toc_row_1-1-m-1 td:nth-child(1),
.__toc_row_1-1-m-1 td:nth-child(2),
.__toc_row_1-m-1-1-1 td:nth-child(1),
.__toc_row_1-1-m-1-1-1 td:nth-child(1),
.__toc_row_1-1-m-1-1-1 td:nth-child(2) {
	text-align: right;
	white-space: nowrap;
	padding-right: 1em;
}

/* Select the main cell */
.__toc_row_1-m-1 td:nth-child(2),
.__toc_row_m-1 td:nth-child(1),
.__toc_row_m-1-1 td:nth-child(1),
.__toc_row_m-1-1-1 td:nth-child(1),
.__toc_row_1-1-m-1 td:nth-child(3),
.__toc_row_1-m-1-1-1 td:nth-child(2),
.__toc_row_1-1-m-1-1-1 td:nth-child(3) {
	width: 99%;
}

/* The last cell is the page number */
.__toc_row_1-m-1 td:last-child,
.__toc_row_1-1-m-1 td:last-child,
.__toc_row_m-1 td:last-child,
.__toc_row_m-1-1 td:last-child, .__toc_row_m-1-1 td:nth-child(2),
.__toc_row_m-1-1-1 td:nth-child(2),
.__toc_row_1-m-1-1-1 td:nth-child(3),
.__toc_row_1-1-m-1-1-1 td:nth-child(4) {
	vertical-align: bottom;
	text-align: right;
	padding-left: 1em;
	white-space: nowrap;
}

/* The other cells in the two page numbers class */
.__toc_row_m-1-1-1 td:last-child, 
.__toc_row_1-m-1-1-1 td:last-child,
.__toc_row_1-1-m-1-1-1 td:last-child {
	vertical-align: bottom;
	text-align: right;
	padding-left: 0.5em;
	white-space: nowrap;
}

/* The "dash cell" should be centered align */
.__toc_row_m-3 td:last-child, 
.__toc_row_m-1-1-1 td:nth-child(3),
.__toc_row_1-m-1-1-1 td:nth-child(4),
.__toc_row_1-1-m-1-1-1 td:nth-child(5) {
	vertical-align: bottom;
	text-align: center;
	padding-left: 0.5em;
	white-space: nowrap;
}

/* Rows with L/C/R aligned first cells (this includes {{TOC row l/c/r}}) */
.__toc_row_first-l td:first-child {
	text-align: left;
}
.__toc_row_first-c td:first-child {
	text-align: center;
}
.__toc_row_first-r td:first-child {
	text-align: right;
}

/* Hanging indents */
.__toc_row_2out-1 td:nth-child(1),
.__toc_row_1-out-1 td:nth-child(2),
.__toc_row_1-1-out td:last-child {
	text-indent: -1.50em;
	padding-left: 1.50em;
}

/* override class to remove padding from the first cells */
.__no_first_col_padding td:nth-child(1) {
	padding-right: 0;
}
.__no_last_col_padding td:last-child {
	padding-left: 0;
}