diff --git a/docs/src/pages/playground.astro b/docs/src/pages/playground.astro index 19df16b..0a0fc70 100644 --- a/docs/src/pages/playground.astro +++ b/docs/src/pages/playground.astro @@ -457,16 +457,25 @@ const baseHref = import.meta.env.BASE_URL; tab-size: var(--tab-width, 2); background: transparent !important; } - .output code { display: block; counter-reset: line; } + /* Line numbers live in reserved padding, absolutely positioned, + so they never join the inline flow: CSS tab stops are measured + from the line box start, and an inline gutter would shift the + first tab stop by its own width. */ + .output code { display: block; white-space: normal; counter-reset: line; } .output .line { + display: block; + position: relative; + white-space: pre; + min-height: 22px; counter-increment: line; + padding-left: 4.3rem; padding-right: 1rem; } .output .line::before { content: counter(line); - display: inline-block; + position: absolute; + left: 0; width: 3.2rem; - padding-right: 1.1rem; text-align: right; color: #4a4453; font-family: "JetBrains Mono", monospace;