.tree element.
(We use this as a shorthand for
"element with class tree".)
.node elements.
.node element contains
<div class="leaf">
element),
<ul> element.
<ul> element contains zero or more
<li> elements (as usual).
<li> element contains one or more
.node elements
(just like the top level element).
@scope and thus requires
a browser that is not too old.
In particular Firefox began to support this only with
version 146 from December 2025.
ul and li
as well as the classes tree and node
should only be used in the places mentioned above.
<li> element
contains multiple .node elements,
they will be linked by vertical edges.
:scope rule at the beginning of tree.css
provides default values for various custom properties for styling the tree.
These values can be overridden.
They must fit with the CSS properties applied to nodes.
--node-gap provides the vertical distance between
nodes.
--indent is the indentation per list level.
--link-width, --link-height and
--link-radius provide the dimensions
of the "upward hooks".
--edge describes the edge in the form expected by
border-left and border-bottom properties.