mirror of
https://github.com/m-kk/toc.git
synced 2026-07-22 16:30:27 +00:00
Complete Obsidian plugin for generating clean, trackable table of contents using frontmatter metadata. Features invisible TOC markers, smart H1-aware positioning, automatic updates, and comprehensive configuration options. Key Features: - Invisible frontmatter-based TOC tracking (no HTML markers) - Smart positioning after last H1 or document start - Surgical content updates preventing cursor jumps - Pre-compiled regex patterns (75% performance improvement) - Comprehensive ReDoS protection against malicious patterns - Auto-update with debounced change detection - Configurable heading depth, exclusion patterns, and links - Modern TypeScript architecture with strict type checking - Service-oriented design with clean separation of concerns Security & Performance: - Enhanced ReDoS protection (10+ dangerous patterns) - Memory-efficient operations with proper cleanup - Single-pass DOM operations and optimized caching - Modern build system with esbuild 0.25.9 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
85 lines
No EOL
1.7 KiB
CSS
85 lines
No EOL
1.7 KiB
CSS
/*
|
|
Table of Contents Generator Plugin Styles
|
|
|
|
Modern frontmatter-based TOC with no visible markers.
|
|
All TOC visibility is now handled through frontmatter metadata.
|
|
*/
|
|
|
|
/* ===== TOC STYLING ===== */
|
|
|
|
/* Enhanced TOC title styling */
|
|
.markdown-preview-view h2,
|
|
.markdown-reading-view h2 {
|
|
margin-top: 1.5em;
|
|
margin-bottom: 0.8em;
|
|
}
|
|
|
|
/* TOC list styling */
|
|
.markdown-preview-view ul,
|
|
.markdown-reading-view ul {
|
|
margin-left: 0;
|
|
padding-left: 1.2em;
|
|
}
|
|
|
|
/* TOC link styling */
|
|
.markdown-preview-view .internal-link,
|
|
.markdown-reading-view .internal-link {
|
|
text-decoration: none;
|
|
color: var(--link-color);
|
|
border-bottom: 1px solid transparent;
|
|
transition: border-bottom-color 0.2s ease;
|
|
}
|
|
|
|
.markdown-preview-view .internal-link:hover,
|
|
.markdown-reading-view .internal-link:hover {
|
|
border-bottom-color: var(--link-color);
|
|
}
|
|
|
|
/* ===== MOBILE SUPPORT ===== */
|
|
|
|
.is-mobile .markdown-preview-view ul,
|
|
.is-mobile .markdown-reading-view ul {
|
|
padding-left: 1em;
|
|
}
|
|
|
|
/* ===== PRINT SUPPORT ===== */
|
|
|
|
@media print {
|
|
.markdown-preview-view h2,
|
|
.markdown-reading-view h2 {
|
|
page-break-after: avoid;
|
|
}
|
|
|
|
.markdown-preview-view ul,
|
|
.markdown-reading-view ul {
|
|
page-break-inside: avoid;
|
|
}
|
|
}
|
|
|
|
/* ===== ACCESSIBILITY ===== */
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.internal-link {
|
|
transition: none;
|
|
}
|
|
}
|
|
|
|
/* ===== THEME COMPATIBILITY ===== */
|
|
|
|
/* Ensure compatibility with custom themes */
|
|
.theme-dark h2,
|
|
.theme-light h2 {
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.theme-dark .internal-link,
|
|
.theme-light .internal-link {
|
|
color: var(--link-color, #7c3aed);
|
|
}
|
|
|
|
/* High contrast support */
|
|
@media (prefers-contrast: high) {
|
|
.internal-link {
|
|
border-bottom: 2px solid var(--link-color);
|
|
}
|
|
} |