From 3e39e1ed63949f7e646b2fa74106d236e442a003 Mon Sep 17 00:00:00 2001 From: Justineo Date: Fri, 24 Jan 2025 00:15:54 +0800 Subject: [PATCH] fix(kcodeblock): prevent unexpected horizontal scrollbar --- src/components/KCodeBlock/KCodeBlock.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/KCodeBlock/KCodeBlock.vue b/src/components/KCodeBlock/KCodeBlock.vue index 5a2e394fe1..e5ab7c295f 100644 --- a/src/components/KCodeBlock/KCodeBlock.vue +++ b/src/components/KCodeBlock/KCodeBlock.vue @@ -898,6 +898,7 @@ $kCodeBlockDarkLineMatchBackgroundColor: rgba(255, 255, 255, 0.12); // we don't display: grid; margin: var(--kui-space-0, $kui-space-0); min-height: 32px; // ensures that scroll bar doesn't show up when there's only one line of content (not to confuse with single line mode) + overflow: visible; position: relative; &:not(.single-line) { @@ -920,6 +921,8 @@ $kCodeBlockDarkLineMatchBackgroundColor: rgba(255, 255, 255, 0.12); // we don't // Lines are rendered by Virtualizer now :deep(.line) { @include codeTypography; + + box-sizing: border-box; display: flex; padding-left: var(--kui-space-40, $kui-space-40);