Expand file type support beyond Markdown to include code, config, and build files with syntax highlighting and improved UI filtering

This commit is contained in:
2026-03-21 11:16:46 -04:00
parent 8a22c1db28
commit 2ed5f65a7a
5 changed files with 738 additions and 70 deletions
+216 -15
View File
@@ -24,6 +24,8 @@
--code-bg: #161b22;
--search-bg: #21262d;
--scrollbar: #30363d;
--resize-handle: #30363d;
--overlay-bg: rgba(0,0,0,0.5);
}
/* ===== THEME — LIGHT ===== */
@@ -43,6 +45,8 @@
--code-bg: #f6f8fa;
--search-bg: #ffffff;
--scrollbar: #d0d7de;
--resize-handle: #d0d7de;
--overlay-bg: rgba(0,0,0,0.3);
}
/* ===== BASE ===== */
@@ -89,6 +93,21 @@ a:hover {
transition: background 200ms ease;
}
.hamburger-btn {
display: none;
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 4px;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.hamburger-btn:hover {
color: var(--accent);
}
.header-logo {
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
@@ -164,24 +183,74 @@ a:hover {
display: flex;
flex: 1;
overflow: hidden;
position: relative;
}
/* --- Mobile overlay --- */
.sidebar-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--overlay-bg);
z-index: 199;
}
.sidebar-overlay.active {
display: block;
}
/* --- Sidebar --- */
.sidebar {
width: 280px;
min-width: 280px;
min-width: 200px;
max-width: 500px;
background: var(--bg-sidebar);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
transition: background 200ms ease;
flex-shrink: 0;
}
/* --- Sidebar filter --- */
.sidebar-filter {
padding: 10px 12px;
border-bottom: 1px solid var(--border);
position: relative;
flex-shrink: 0;
}
.sidebar-filter input {
width: 100%;
padding: 6px 10px 6px 32px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--search-bg);
color: var(--text-primary);
font-family: 'JetBrains Mono', monospace;
font-size: 0.78rem;
outline: none;
transition: border-color 200ms ease;
}
.sidebar-filter input:focus {
border-color: var(--accent);
}
.sidebar-filter-icon {
position: absolute;
left: 22px;
top: 50%;
transform: translateY(-50%);
color: var(--text-muted);
pointer-events: none;
}
.sidebar-tree {
flex: 1;
overflow-y: auto;
padding: 12px 0;
min-height: 80px;
}
.sidebar-tree::-webkit-scrollbar {
@@ -225,6 +294,9 @@ a:hover {
background: var(--bg-hover);
color: var(--accent);
}
.tree-item.filtered-out {
display: none;
}
.tree-item .icon {
width: 16px;
@@ -246,13 +318,33 @@ a:hover {
.tree-children.collapsed {
display: none;
}
.tree-children.filtered-out {
display: none;
}
/* --- Tag resize handle --- */
.tag-resize-handle {
height: 5px;
cursor: ns-resize;
background: transparent;
border-top: 1px solid var(--border);
flex-shrink: 0;
transition: background 150ms ease;
}
.tag-resize-handle:hover,
.tag-resize-handle.active {
background: var(--accent);
opacity: 0.5;
}
/* --- Tag Cloud --- */
.tag-cloud-section {
border-top: 1px solid var(--border);
padding: 12px 16px;
max-height: 180px;
height: 180px;
min-height: 60px;
max-height: 400px;
overflow-y: auto;
flex-shrink: 0;
}
.tag-cloud-section::-webkit-scrollbar {
width: 6px;
@@ -292,13 +384,32 @@ a:hover {
.tag-item:hover {
opacity: 0.8;
}
.tag-item.filtered-out {
display: none;
}
/* --- Sidebar resize handle (horizontal) --- */
.sidebar-resize-handle {
width: 5px;
cursor: ew-resize;
background: transparent;
flex-shrink: 0;
transition: background 150ms ease;
z-index: 10;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.active {
background: var(--accent);
opacity: 0.5;
}
/* --- Content Area --- */
.content-area {
flex: 1;
overflow-y: auto;
padding: 28px 40px 60px;
padding: clamp(16px, 3vw, 40px) clamp(16px, 4vw, 40px) 60px;
transition: background 200ms ease;
min-width: 0;
}
.content-area::-webkit-scrollbar {
width: 8px;
@@ -384,8 +495,12 @@ a:hover {
}
.file-actions {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
}
.btn-copy-path {
.btn-action {
font-family: 'JetBrains Mono', monospace;
font-size: 0.75rem;
padding: 4px 10px;
@@ -395,11 +510,19 @@ a:hover {
color: var(--text-secondary);
cursor: pointer;
transition: color 150ms ease, border-color 150ms ease;
display: inline-flex;
align-items: center;
gap: 4px;
}
.btn-copy-path:hover {
.btn-action:hover {
color: var(--accent);
border-color: var(--accent);
}
.btn-action.active {
color: var(--accent);
border-color: var(--accent);
background: var(--tag-bg);
}
/* Frontmatter collapsible */
.frontmatter-toggle {
@@ -432,6 +555,24 @@ a:hover {
display: block;
}
/* --- Raw source view --- */
.raw-source-view {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 16px;
margin-top: 12px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.82rem;
color: var(--text-secondary);
white-space: pre-wrap;
word-break: break-word;
overflow-x: auto;
line-height: 1.55;
max-height: 70vh;
overflow-y: auto;
}
/* --- Markdown Rendered Content --- */
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
@@ -600,22 +741,82 @@ a:hover {
padding: 1px 6px;
}
/* --- Responsive --- */
@media (max-width: 768px) {
/* --- No-select during resize --- */
body.resizing {
user-select: none;
-webkit-user-select: none;
cursor: ew-resize;
}
body.resizing-v {
user-select: none;
-webkit-user-select: none;
cursor: ns-resize;
}
/* --- Responsive — Tablet --- */
@media (max-width: 1024px) {
.sidebar {
width: 220px;
min-width: 220px;
}
.content-area {
padding: 20px;
width: 240px;
min-width: 200px;
}
}
@media (max-width: 600px) {
/* --- Responsive — Mobile --- */
@media (max-width: 768px) {
.hamburger-btn {
display: flex;
}
.header {
gap: 8px;
padding: 8px 12px;
}
.header-logo {
font-size: 1rem;
}
.search-wrapper {
max-width: none;
flex: 1;
}
.search-vault-filter {
font-size: 0.72rem;
padding: 5px 6px;
}
.sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
z-index: 200;
width: 280px !important;
min-width: 280px !important;
max-width: 85vw !important;
transform: translateX(-100%);
transition: transform 250ms ease, background 200ms ease;
box-shadow: none;
}
.sidebar.mobile-open {
transform: translateX(0);
box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}
.sidebar-resize-handle {
display: none;
}
.content-area {
padding: 16px;
padding: 16px 12px 60px;
}
.file-title {
font-size: 1.2rem;
}
.file-actions {
flex-wrap: wrap;
}
}