Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Tree list/styles.css: Difference between revisions

Template page
Content deleted Content added
no reason to be protocol relative these days, some ws
 
Use Codex variable for design consistency and consistency in dark mode
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
/* {{pp-template}} */
/* {{pp-template}} */

⚫
.treeview ul {
/*
don't draw over infobox when list is on the left of an infobox, see:
https://en.wikipedia.org/wiki/Template_talk:Tree_list#Tree_list_breaks_clicking_links_in_infoboxes
but also don't break infobox width when the list is inside of an infobox, see:
https://pl.wikipedia.org/wiki/Dyskusja_wikiprojektu:Infoboksy#c-Bastruk-20260525205400-Nux-20260525195700
*/
div.treelist {
display: flow-root;
}

⚫
.treelist ul {
padding: 0;
padding: 0;
margin: 0;
margin: 0;
}
}


.treeview li {
.treelist li {
padding: 0;
padding: 0;
margin: 0;
margin: 0;
list-style-type: none;
list-style: none;
position: relative;
list-style-image: none;
}
}


.treeview li li {
.treelist li li {
background: url("https://upload.wikimedia.org/wikipedia/commons/f/f2/Treeview-grey-line.png") no-repeat 0 -2981px;
/* @noflip */
/* @noflip */
padding-left: 21px;
padding-left: 21px;
Line 19: Line 29:
}
}


/* vertical line */
⚫
.treeview li li:last-child {
.treelist li li::before {
background-position: 0 -5971px
content: "";
position: absolute;
left: 10px;
top: 0;
bottom: 0;
width: 1px;
border-left: 1px solid var(--border-color-interactive, #72777d);
}
}


⚫
.treelist li li:last-child::before {
⚫
/* first line here deals with new situation after RemexHTML switch,
bottom: calc(100% - 0.7em);
⚫
* where emptyline cause the first child to become the 2nd child. Such a mess
}

/* horizontal line */
.treelist li li::after {
content: "";
position: absolute;
left: 10px;
top: 0.7em;
width: 11px;
border-top: 1px solid var(--border-color-interactive, #72777d);
}

⚫
/* these lines deal with a new situation after the RemexHTML switch,
* wherein li.treelist_emptyline inserts an additional .mw-empty-elt element before
⚫
* the .treelist_emptyline element, causing the 1st child to become the 2nd child
*/
*/
.treeview li.emptyline > ul > .mw-empty-elt:first-child + .emptyline,
.treelist li.treelist_emptyline > ul > .mw-empty-elt:first-child + .treelist_emptyline::before,
.treeview li.emptyline > ul > li:first-child {
.treelist li.treelist_emptyline > ul > :not(.mw-empty-elt):first-of-type::before {
top: 0.7em;
background-position: 0 9px
}

.treelist li.treelist_emptyline > ul > .mw-empty-elt:first-child + .treelist_emptyline::after,
.treelist li.treelist_emptyline > ul > :not(.mw-empty-elt):first-of-type::after {
left: 0;
width: 21px;
}
}

Latest revision as of 23:37, 22 October 2026

/* {{pp-template}} */

/* 
	don't draw over infobox when list is on the left of an infobox, see:
	https://en.wikipedia.org/wiki/Template_talk:Tree_list#Tree_list_breaks_clicking_links_in_infoboxes
	but also don't break infobox width when the list is inside of an infobox, see:
	https://pl.wikipedia.org/wiki/Dyskusja_wikiprojektu:Infoboksy#c-Bastruk-20260525205400-Nux-20260525195700
*/
div.treelist {
	display: flow-root;
}

.treelist ul {
	padding: 0;
	margin: 0;
}

.treelist li {
	padding: 0;
	margin: 0;
	list-style: none;
	position: relative;
}

.treelist li li {
	/* @noflip */
	padding-left: 21px;
	text-indent: 0.3em;
}

/* vertical line */
.treelist li li::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 0;
	bottom: 0;
	width: 1px;
	border-left: 1px solid var(--border-color-interactive, #72777d);
}

.treelist li li:last-child::before {
	bottom: calc(100% - 0.7em);
}

/* horizontal line */
.treelist li li::after {
	content: "";
	position: absolute;
	left: 10px;
	top: 0.7em;
	width: 11px;
	border-top: 1px solid var(--border-color-interactive, #72777d);
}

/* these lines deal with a new situation after the RemexHTML switch,
 * wherein li.treelist_emptyline inserts an additional .mw-empty-elt element before
 * the .treelist_emptyline element, causing the 1st child to become the 2nd child
 */
.treelist li.treelist_emptyline > ul > .mw-empty-elt:first-child + .treelist_emptyline::before,
.treelist li.treelist_emptyline > ul > :not(.mw-empty-elt):first-of-type::before {
	top: 0.7em;
}

.treelist li.treelist_emptyline > ul > .mw-empty-elt:first-child + .treelist_emptyline::after,
.treelist li.treelist_emptyline > ul > :not(.mw-empty-elt):first-of-type::after {
	left: 0;
	width: 21px;
}