Skip to content

Commit 9befaed

Browse files
committed
Hide empty diagram containers and fix offline entry borders
- Hide .dict-word-family and .dict-semantic-map when empty (Mermaid failed to render) to avoid a stray border-top line at the bottom - Switch offline entries from border-bottom to border-top on siblings to avoid a trailing line after the last entry
1 parent 42d16a6 commit 9befaed

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

crates/markdown_preview_core/js/dictionary.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
.dict-source-badge.offline { background: #0d2240; color: #58a6ff; }
412412
.dict-source-badge.online { background: #0d2d1a; color: #3fb950; }
413413
.dict-source-badge.ai { background: #3d2e00; color: #d29922; }
414-
.dict-offline-entry { border-bottom-color: #30363d; }
414+
.dict-offline-entry + .dict-offline-entry { border-top-color: #30363d; }
415415
.dict-entry { border-top-color: #30363d; }
416416
.dict-ai-loading { color: #8b949e; }
417417

@@ -462,9 +462,13 @@
462462

463463
/* Offline dictionary entry container */
464464
.dict-offline-entry {
465-
margin-bottom: 20px;
466-
padding-bottom: 20px;
467-
border-bottom: 1px solid #d0d7de;
465+
margin-bottom: 0;
466+
padding-bottom: 0;
467+
}
468+
.dict-offline-entry + .dict-offline-entry {
469+
margin-top: 20px;
470+
padding-top: 20px;
471+
border-top: 1px solid #d0d7de;
468472
}
469473
.dict-offline-content { font-size: 14px; line-height: 1.6; overflow: auto; position: relative; }
470474

@@ -536,6 +540,10 @@
536540
padding-top: 16px;
537541
border-top: 1px solid #d0d7de;
538542
}
543+
.dict-word-family:empty,
544+
.dict-semantic-map:empty {
545+
display: none;
546+
}
539547
.dict-diagram-label {
540548
font-size: 12px;
541549
font-weight: 700;

0 commit comments

Comments
 (0)