arcaneTocTreeLinesCss top-level constant
String
const arcaneTocTreeLinesCss
CSS styles for ArcaneToc tree-line visual connectors.
Include this in your stylesheet's baseCss for tree-line styling. Provides comprehensive tree visualization with proper vertical/horizontal line connectors, scrollbar styling, and active state highlighting.
Implementation
const String arcaneTocTreeLinesCss = '''
/* ============================================
TABLE OF CONTENTS - Tree Line Styles
Clean tree view with subtle connecting lines
============================================ */
/* Scrollbar styling for TOC container */
.kb-toc,
.toc-container {
scrollbar-width: thin;
scrollbar-color: var(--border) transparent;
}
.kb-toc::-webkit-scrollbar,
.toc-container::-webkit-scrollbar {
width: 4px;
}
.kb-toc::-webkit-scrollbar-track,
.toc-container::-webkit-scrollbar-track {
background: transparent;
}
.kb-toc::-webkit-scrollbar-thumb,
.toc-container::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 2px;
}
/* TOC content with tree lines */
.toc-content ul {
list-style: none;
padding-left: 0;
margin: 0;
position: relative;
}
/* Top-level list gets tree line padding */
.toc-content > ul {
padding-left: 0.75rem;
margin-left: 0.25rem;
}
/* Nested lists */
.toc-content ul ul {
padding-left: 0.875rem;
margin-left: 0.375rem;
margin-top: 0.25rem;
position: relative;
}
/* All list items */
.toc-content li {
position: relative;
}
/* Horizontal branch for top-level items */
.toc-content > ul > li::before {
content: '';
position: absolute;
left: -0.5rem;
top: 50%;
width: 0.375rem;
height: 1px;
background: var(--border);
}
/* Vertical line segment for top-level items (not last) */
.toc-content > ul > li:not(:last-child)::after {
content: '';
position: absolute;
left: -0.5rem;
top: 0;
bottom: 0;
width: 1px;
background: var(--border);
}
/* Last top-level item - vertical line only to center (L-bend) */
.toc-content > ul > li:last-child::after {
content: '';
position: absolute;
left: -0.5rem;
top: 0;
height: 50%;
width: 1px;
background: var(--border);
}
/* Horizontal branch for nested items */
.toc-content ul ul li::before {
content: '';
position: absolute;
left: -0.875rem;
top: 50%;
width: 0.5rem;
height: 1px;
background: var(--border);
}
/* Vertical line segment for nested items (not last) */
.toc-content ul ul li:not(:last-child)::after {
content: '';
position: absolute;
left: -0.875rem;
top: 0;
bottom: 0;
width: 1px;
background: var(--border);
}
/* Last nested item - vertical line only to center (L-bend) */
.toc-content ul ul li:last-child::after {
content: '';
position: absolute;
left: -0.875rem;
top: 0;
height: 50%;
width: 1px;
background: var(--border);
}
/* Single child - show dot instead of tree lines */
.toc-content > ul:has(> li:only-child) > li::before,
.toc-content > ul:has(> li:only-child) > li::after {
display: none;
}
.toc-content ul ul:has(> li:only-child) > li::before,
.toc-content ul ul:has(> li:only-child) > li::after {
display: none;
}
/* Link styling */
.toc-content a {
color: var(--muted-foreground);
text-decoration: none;
font-size: 0.8125rem;
line-height: 1.3;
display: block;
margin-left: 0.125rem;
padding: 0.5rem 0.75rem 0.5rem 0.625rem !important;
border-radius: var(--radius-sm);
transition: color 0.15s ease, background 0.15s ease;
}
.toc-content a:hover {
color: var(--foreground);
background: var(--muted);
}
/* Active TOC link */
.toc-content a.toc-active {
color: var(--foreground);
font-weight: 500;
background: var(--muted);
}
/* Nested link sizing */
.toc-content ul ul a {
font-size: 0.8125rem;
line-height: 1.3;
padding: 0.5rem 0.75rem 0.5rem 0.625rem !important;
}
/* Fading tree lines at deeper nesting levels */
.toc-content ul ul li::before,
.toc-content ul ul li::after {
background: color-mix(in srgb, var(--border) 70%, transparent);
}
.toc-content ul ul ul li::before,
.toc-content ul ul ul li::after {
background: color-mix(in srgb, var(--border) 50%, transparent);
}
''';