Template:Flatlist/styles.css: Difference between revisions

From BoyWiki
(Created page with "→‎* * Style for horizontal lists (separator following item). * @source mediawiki.org/wiki/Snippets/Horizontal_lists * @revision 7 (2015-11-12) * @author [[User:Edokter]]: .wst-flatlist { display: inline-block; } .wst-flatlist dl, .wst-flatlist ol, .wst-flatlist ul { margin: 0; padding: 0; } →‎Display list items inline: .wst-flatlist dd, .wst-flatlist dt, .wst-flatlist li { display: inline; margin: 0; } →‎Do not display empty list items: ...")
 
No edit summary
 
Line 1: Line 1:
/* Should be kept in sync with [[MediaWiki:Common.css]] */
/**
/**
  * Style for horizontal lists (separator following item).
  * Style for horizontal lists (separator following item).
  * @source mediawiki.org/wiki/Snippets/Horizontal_lists
  * @source https://www.mediawiki.org/wiki/Snippets/Horizontal_lists
  * @revision 7 (2015-11-12)
  * @revision 9 (2016-08-10)
  * @author [[User:Edokter]]
  * @author [[User:Edokter]]
  */
  */
.wst-flatlist {
.hlist dl,
    display: inline-block;
.hlist ol,
.hlist ul {
margin: 0;
padding: 0;
}
}


.wst-flatlist dl,
.wst-flatlist ol,
.wst-flatlist ul {
    margin: 0;
    padding: 0;
}
/* Display list items inline */
/* Display list items inline */
.wst-flatlist dd,
.hlist dd,
.wst-flatlist dt,
.hlist dt,
.wst-flatlist li {
.hlist li {
    display: inline;
/* don't trust the note that says margin doesn't work with inline
    margin: 0;
* removing margin: 0 makes dds have margins again */
margin: 0;
display: inline;
}
}
/* Do not display empty list items */
 
.wst-flatlist li.mw-empty-li {
/* Display nested lists inline */
    display: none;
.hlist.inline,
    margin: 0;
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
.hlist dl dl, .hlist dl ol, .hlist dl ul,
.hlist ol dl, .hlist ol ol, .hlist ol ul,
.hlist ul dl, .hlist ul ol, .hlist ul ul {
display: inline;
}
}
/* Display nested lists inline */
 
.wst-flatlist.inline,
/* Hide empty list items */
.wst-flatlist.inline dl,
.hlist .mw-empty-li,
.wst-flatlist.inline ol,
.hlist .mw-empty-elt {
.wst-flatlist.inline ul,
display: none;
.wst-flatlist dl dl, .wst-flatlist dl ol, .wst-flatlist dl ul,
.wst-flatlist ol dl, .wst-flatlist ol ol, .wst-flatlist ol ul,
.wst-flatlist ul dl, .wst-flatlist ul ol, .wst-flatlist ul ul {
    display: inline;
}
}
/* Generate interpuncts */
/* Generate interpuncts */
.wst-flatlist dt:after {
.hlist dt:after {
    content: ": ";
content: ": ";
}
}
.wst-flatlist dd:after,
 
.wst-flatlist li:after {
.hlist dd:after,
    content: " \00B7 ";
.hlist li:after {
    font-weight: bold;
content: " · ";
font-weight: bold;
}
}


/* Comma separators */
.hlist dd:last-child:after,
.wst-flatlist-comma dd:after,
.hlist dt:last-child:after,
.wst-flatlist-comma li:after {
.hlist li:last-child:after {
    content: ", ";
content: none;
    font-weight: normal;
}
}


.wst-flatlist dd:last-child:after,
.wst-flatlist dt:last-child:after,
.wst-flatlist li:last-child:after {
    content: none;
}
/* Add parentheses around nested lists */
/* Add parentheses around nested lists */
.wst-flatlist dd dd:first-child:before, .wst-flatlist dd dt:first-child:before, .wst-flatlist dd li:first-child:before,
.hlist dd dd:first-child:before, .hlist dd dt:first-child:before, .hlist dd li:first-child:before,
.wst-flatlist dt dd:first-child:before, .wst-flatlist dt dt:first-child:before, .wst-flatlist dt li:first-child:before,
.hlist dt dd:first-child:before, .hlist dt dt:first-child:before, .hlist dt li:first-child:before,
.wst-flatlist li dd:first-child:before, .wst-flatlist li dt:first-child:before, .wst-flatlist li li:first-child:before {
.hlist li dd:first-child:before, .hlist li dt:first-child:before, .hlist li li:first-child:before {
    content: " (";
content: " (";
    font-weight: normal;
font-weight: normal;
}
}
.wst-flatlist dd dd:last-child:after, .wst-flatlist dd dt:last-child:after, .wst-flatlist dd li:last-child:after,
 
.wst-flatlist dt dd:last-child:after, .wst-flatlist dt dt:last-child:after, .wst-flatlist dt li:last-child:after,
.hlist dd dd:last-child:after, .hlist dd dt:last-child:after, .hlist dd li:last-child:after,
.wst-flatlist li dd:last-child:after, .wst-flatlist li dt:last-child:after, .wst-flatlist li li:last-child:after {
.hlist dt dd:last-child:after, .hlist dt dt:last-child:after, .hlist dt li:last-child:after,
    content: ") ";
.hlist li dd:last-child:after, .hlist li dt:last-child:after, .hlist li li:last-child:after {
    font-weight: normal;
content: ")";
font-weight: normal;
}
}
/* Put ordinals in front of ordered list items */
/* Put ordinals in front of ordered list items */
.wst-flatlist ol {
.hlist ol {
    counter-reset: listitem;
counter-reset: listitem;
}
}
.wst-flatlist ol > li {
 
    counter-increment: listitem;
.hlist ol > li {
counter-increment: listitem;
}
}
.wst-flatlist ol > li:before {
 
    content: " " counter(listitem) " ";
.hlist ol > li:before {
    white-space: nowrap;
content: " " counter(listitem) "\a0";
}
}
.wst-flatlist dd ol > li:first-child:before,
 
.wst-flatlist dt ol > li:first-child:before,
.hlist dd ol > li:first-child:before,
.wst-flatlist li ol > li:first-child:before {
.hlist dt ol > li:first-child:before,
    content: " (" counter(listitem) " ";
.hlist li ol > li:first-child:before {
content: " (" counter(listitem) "\a0";
}
}

Latest revision as of 23:08, 1 June 2022

/* Should be kept in sync with [[MediaWiki:Common.css]] */

/**
 * Style for horizontal lists (separator following item).
 * @source https://www.mediawiki.org/wiki/Snippets/Horizontal_lists
 * @revision 9 (2016-08-10)
 * @author [[User:Edokter]]
 */
.hlist dl,
.hlist ol,
.hlist ul {
	margin: 0;
	padding: 0;
}

/* Display list items inline */
.hlist dd,
.hlist dt,
.hlist li {
	/* don't trust the note that says margin doesn't work with inline
	 * removing margin: 0 makes dds have margins again */
	margin: 0;
	display: inline;
}

/* Display nested lists inline */
.hlist.inline,
.hlist.inline dl,
.hlist.inline ol,
.hlist.inline ul,
.hlist dl dl, .hlist dl ol, .hlist dl ul,
.hlist ol dl, .hlist ol ol, .hlist ol ul,
.hlist ul dl, .hlist ul ol, .hlist ul ul {
	display: inline;
}

/* Hide empty list items */
.hlist .mw-empty-li,
.hlist .mw-empty-elt {
	display: none;
}

/* Generate interpuncts */
.hlist dt:after {
	content: ": ";
}

.hlist dd:after,
.hlist li:after {
	content: " · ";
	font-weight: bold;
}

.hlist dd:last-child:after,
.hlist dt:last-child:after,
.hlist li:last-child:after {
	content: none;
}

/* Add parentheses around nested lists */
.hlist dd dd:first-child:before, .hlist dd dt:first-child:before, .hlist dd li:first-child:before,
.hlist dt dd:first-child:before, .hlist dt dt:first-child:before, .hlist dt li:first-child:before,
.hlist li dd:first-child:before, .hlist li dt:first-child:before, .hlist li li:first-child:before {
	content: " (";
	font-weight: normal;
}

.hlist dd dd:last-child:after, .hlist dd dt:last-child:after, .hlist dd li:last-child:after,
.hlist dt dd:last-child:after, .hlist dt dt:last-child:after, .hlist dt li:last-child:after,
.hlist li dd:last-child:after, .hlist li dt:last-child:after, .hlist li li:last-child:after {
	content: ")";
	font-weight: normal;
}

/* Put ordinals in front of ordered list items */
.hlist ol {
	counter-reset: listitem;
}

.hlist ol > li {
	counter-increment: listitem;
}

.hlist ol > li:before {
	content: " " counter(listitem) "\a0";
}

.hlist dd ol > li:first-child:before,
.hlist dt ol > li:first-child:before,
.hlist li ol > li:first-child:before {
	content: " (" counter(listitem) "\a0";
}