feat: add line numbers to code blocks, enhance search overlay functionality, and improve navbar search visibility
This commit is contained in:
1 parent
fa211d243f
commit
64737582a5
5 files changed
+114
-17
No files matched your search
+54
-4
@@ -1862,6 +1862,22 @@ pre code.hljs {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
/* Line numbers (highlightjs-line-numbers plugin builds a table inside <code>) */
|
||||
.hljs-ln { border-collapse: collapse; }
|
||||
.hljs-ln td { padding: 0; border: 0; vertical-align: top; }
|
||||
.hljs-ln-numbers {
|
||||
width: 1%;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
padding-right: 0.9em !important;
|
||||
color: var(--text-muted);
|
||||
border-right: 1px solid var(--border-color);
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
.hljs-ln-code { padding-left: 0.9em !important; }
|
||||
.hljs-ln-n::before { content: attr(data-line-number); }
|
||||
|
||||
/* ========================================
|
||||
ANCHOR OFFSET — clear the fixed navbar on ToC / hash jumps
|
||||
Without this, jumping to a heading lands it at y=0, hidden behind the
|
||||
@@ -2277,11 +2293,21 @@ button:focus:not(:focus-visible) {
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
padding: 1rem 1.2rem;
|
||||
border: none;
|
||||
.search-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
padding: 0 1.1rem;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.search-icon { flex: 0 0 auto; color: var(--text-muted); }
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0.95rem 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-sans);
|
||||
@@ -2291,6 +2317,30 @@ button:focus:not(:focus-visible) {
|
||||
|
||||
.search-input::placeholder { color: var(--text-muted); }
|
||||
|
||||
.search-hint {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 0.5rem 1.1rem;
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.search-hint kbd {
|
||||
padding: 0.05em 0.4em;
|
||||
font-family: var(--font-sans);
|
||||
font-size: 0.95em;
|
||||
color: var(--text-secondary);
|
||||
background: var(--bg-subtle);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Navbar search button — hidden until JS reveals it (no on-page search in view) */
|
||||
.nav-search { display: none; }
|
||||
.nav-search.is-visible { display: block; }
|
||||
|
||||
.search-results {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
|
||||
Reference in new issue
Block a user