From 38bf2894feff81eb95c39319297e650b79d12b05 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 20 Sep 2024 15:20:39 +0200 Subject: [PATCH] Improve paddings for code blocks line numbers --- src/librustdoc/html/static/css/rustdoc.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 01506b46af2e..04b0eba74509 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -831,10 +831,14 @@ both the code example and the line numbers, so we need to remove the radius in t -webkit-user-select: none; user-select: none; padding: 14px 8px; + padding-right: 2px; color: var(--src-line-numbers-span-color); } -.rustdoc .scraped-example .src-line-numbers { +.rustdoc .scraped-example .example-wrap .src-line-numbers { + padding: 0; +} +.rustdoc .src-line-numbers pre { padding: 14px 0; } .src-line-numbers a, .src-line-numbers span { @@ -893,7 +897,7 @@ both the code example and the line numbers, so we need to remove the radius in t } .docblock code, .docblock-short code, -pre, .rustdoc.src .example-wrap { +pre, .rustdoc.src .example-wrap, .example-wrap .src-line-numbers { background-color: var(--code-block-background-color); }