diff --git a/src/viewport-controller.js b/src/viewport-controller.js index ccc1d0b..9742073 100644 --- a/src/viewport-controller.js +++ b/src/viewport-controller.js @@ -69,6 +69,11 @@ class ViewportController { [data-embed-id="${embedId}"] .cm-line:nth-child(n+${domEndLine + 1}) { display: none !important; } + + /* Catch-all to prevent overlapping text in collapsed line numbers */ + [data-embed-id="${embedId}"] .cm-gutterElement[style*="height: 0px"]:not([style*="visibility: hidden"]) { + display: none !important; + } `; style.textContent = css; diff --git a/styles.css b/styles.css index ca460b5..a8af741 100644 --- a/styles.css +++ b/styles.css @@ -30,11 +30,6 @@ border-radius: 4px; /* Optional rounding for callouts */ } -/* Compensate top padding when in callout mode to match bottom padding */ -.sync-embed.is-callout-style .cm-content { - padding-top: 12px !important; -} - /* === UNIFIED UI HEADER === */ .sync-embed-header { font-size: var(--inline-title-size, var(--h1-size, 2em)); @@ -165,12 +160,17 @@ /* 16px padding creates a flush left edge */ .sync-embed .cm-content { background-color: transparent !important; - padding-top: 12px !important; + /* padding-top: 12px !important; */ padding-bottom: 12px !important; padding-left: 16px !important; padding-right: 16px !important; } +/* Applying general padding to the container keeps both line numbers and content vertically aligned */ +.sync-embed .cm-contentContainer { + padding-top: 12px !important; +} + .sync-embed .markdown-source-view.mod-cm6 .cm-editor { width: 100%; }