From 056b05d1c9ce8d963fcd02eceb9214ed595b3b97 Mon Sep 17 00:00:00 2001 From: Mercurio Date: Thu, 12 May 2022 18:49:05 +0100 Subject: [PATCH] feat: add line number in code blocks --- site2/website-next/src/css/custom.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/site2/website-next/src/css/custom.css b/site2/website-next/src/css/custom.css index 06feb70309e9..d32855ba9ec6 100644 --- a/site2/website-next/src/css/custom.css +++ b/site2/website-next/src/css/custom.css @@ -981,4 +981,20 @@ footer .row.footer__links { } .theme-doc-version-badge { display: none; +} + +.prism-code { + counter-reset: line-number; +} + +.prism-code .token-line::marker { + color: var(--ifm-color-gray-700); + content: counter(line-number); +} + +.prism-code .token-line { + counter-increment: line-number; + display: list-item; + padding-left: var(--ifm-pre-padding); + margin-left: var(--ifm-global-spacing); } \ No newline at end of file