Template:Tree list/styles.css: Difference between revisions
Template page
More actions
Content deleted Content added
Revert |
m spelling |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
/* {{pp-template}} */ |
/* {{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 { |
.treelist ul { |
||
padding: 0; |
padding: 0; |
||
| Line 8: | Line 19: | ||
padding: 0; |
padding: 0; |
||
margin: 0; |
margin: 0; |
||
list-style |
list-style: none; |
||
position: relative; |
|||
list-style-image: none; |
|||
} |
} |
||
.treelist 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 */ |
|||
| ⚫ | |||
.treelist li li::before { |
|||
background-position: 0 -5971px |
|||
content: ""; |
|||
position: absolute; |
|||
left: 10px; |
|||
top: 0; |
|||
bottom: 0; |
|||
width: 1px; |
|||
border-left: 1px solid #808080; |
|||
} |
} |
||
| ⚫ | |||
| ⚫ | |||
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 #808080; |
|||
} |
|||
| ⚫ | |||
* wherein li.treelist_emptyline inserts an additional .mw-empty-elt element before |
* 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 |
* 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, |
.treelist li.treelist_emptyline > ul > .mw-empty-elt:first-child + .treelist_emptyline::before, |
||
.treelist li.treelist_emptyline > ul > |
.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, |
|||
/* the dimensions of the image at the url are 21px by 5983px |
|||
.treelist li.treelist_emptyline > ul > :not(.mw-empty-elt):first-of-type::after { |
|||
* the amount of the image that is visible adjacent to any single line is 21px by 21px |
|||
left: 0; |
|||
** positioning the image at x = 0px shows the full width of the image from 0px to 21px |
|||
width: 21px; |
|||
** positioning the image at y = 9px shows the portion of the image from a height of -9px to 12px, i.e. 9 empty pixels and the first 12 image pixels |
|||
} |
|||
** positioning the image at y = -2981px shows the portion of the image from a height of 2981px to 3002px, the middle 21 pixels of the image |
|||
** positioning the image at y = -5971px shows the portion of the image from a height of 5971px to height+9px, i.e. the last 12 image pixels and 9 empty pixels |
|||
| ⚫ | |||
Latest revision as of 16:20, 26 May 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 #808080;
}
.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 #808080;
}
/* 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;
}