/*** Variables ***/ :root { --tree-indent-width: 2rem; --transition-duration: 0.15s; --button-bar-icon-size: 1.75rem; } /*** Breadcrumbs ***/ .breadcrumbs { list-style-type: none; display: flex; flex-direction: row; flex-wrap: wrap; height: min-content; margin: 0; padding: 0; align-items: center; opacity: 70%; } .breadcrumb::before { content: ''; display: inline-block; background-image: var(--icon-breadcrumb); background-repeat: no-repeat; background-position: 50% 50%; opacity: 70%; width: 2.25rem; height: 1.2em; vertical-align: text-bottom; } .breadcrumb a { --recursive-mono: 1.0; --recursive-wght: 500; color: var(--text-color); text-decoration: none; } .breadcrumb a:hover { text-decoration: underline; } /*** Tree ***/ .tree { --tree-indent-guide-dim: transparent; --tree-indent-guide-highlighted: transparent; } .tree:has(.branch-container:hover) { --tree-indent-guide-dim: transparent; --tree-indent-guide-highlighted: var(--border-1); } @media (hover: none) { .tree { --tree-indent-guide-dim: var(--border-1); --tree-indent-guide-highlighted: var(--border-1); } } /* Use an indent level appropriate for the viewport. */ .tree ul { --tree-responsive-indent-width: clamp(var(--8px), 2vw, var(--tree-indent-width)); /* Draw indent guides. */ padding-left: calc(var(--tree-responsive-indent-width) / 2); margin-left: calc(var(--tree-responsive-indent-width) / 2); border-left: var(--1px) solid var(--tree-indent-guide-dim); transition: border-left-color var(--transition-duration); } .tree details:has(.branch-container:hover)>ul { border-left-color: var(--tree-indent-guide-highlighted); } /* Top level should not have an indent or a border. */ .tree>ul { padding-left: 0; border-left: none; } .tree details { /* Disable the rightwards chevron in
elements */ &>summary { list-style: none; cursor: pointer; &::-webkit-details-marker { display: none; } } } /* Child branches */ .tree li { /*
  • elements should not have any bullet points or whatever */ list-style: none; /* Stretch branch content to the full width of the page */ &>div, &>details { width: 100%; } /* Add an underline for leaf branches */ &>div { box-sizing: border-box; margin-bottom: calc(- var(--1px)); border-bottom: var(--1px) solid transparent; transition: border-bottom-color var(--transition-duration); &:hover { border-bottom-color: var(--border-1); } } &>div, &>details>summary { /* Child elements are laid out horizontally in a flexbox. */ display: flex; align-items: center; } } /* is used for the visual content of branches with children. It's the large horizontal bar and notably *excludes* children. */ .tree details>summary { /* Slightly round for elegance */ border-radius: var(--8px); /* Give it a shaded background on hover */ background-color: transparent; transition: background-color var(--transition-duration); &:hover { background-color: var(--shaded-background); } } /* For media without hover functionality, draw a bottom border everywhere as a visual anchor for where to tap */ @media (hover: none) { .tree li>div:first-child, .tree li>details>summary:first-child { border-bottom: var(--1px) solid var(--border-1); } .tree details>summary { /* In that case summaries shall not be rounded. */ border-radius: 0; } } /* The following three elements - bp, bc, and bb - are there in all branches, regardless of their parent. */ /* bp - bullet point */ th-bp { display: block; width: var(--tree-indent-width); height: 1.75rem; background-image: var(--icon-leaf); background-repeat: no-repeat; background-position: 50% 50%; /* Prevent shrinkage when viewport is too low */ flex-shrink: 0; } /* Change image of th-bp if it has children and/or is collapsible */ .tree details[open]>summary>th-bp { background-image: var(--icon-collapse); } .tree details:not([open])>summary>th-bp { background-image: var(--icon-expand); } /* bc - branch content */ th-bc { display: block; padding-top: var(--6px); padding-bottom: var(--6px); /* Grow to fill the entire available space. This pushes out th-bb to the far right. */ flex-grow: 1; /* Bit of a hack to make
    s in  have scrollbars proper. */
        &:has(pre, th-literate-program) {
            overflow: hidden;
        }
    }
    
    /* Display a chevron hinting that the collapsed branch has more content in its children. */
    .tree details:not([open])>summary>th-bc>:last-child,
    /* NOTE: Linked branches have a slightly different structure (extra