From f29d46b4d7d6a2466249a456cdba74bafef3a1b8 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Sun, 5 Apr 2026 20:30:55 +0200 Subject: [PATCH] fix(web): use :global() for Shiki's .line class in CSS module CSS modules were mangling .line in selectors like .code-content code > .line, but .line is generated by Shiki and must stay as-is. Wrap with :global(.line) so the selector targets the actual DOM class. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/components/code/file-viewer.module.css | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/webui2/src/components/code/file-viewer.module.css b/webui2/src/components/code/file-viewer.module.css index d7b6953a15120d056530b72bc762d4ec15e7eb3b..49f4cb392e3a8ce63ce4eec824987ff39217cbb2 100644 --- a/webui2/src/components/code/file-viewer.module.css +++ b/webui2/src/components/code/file-viewer.module.css @@ -14,22 +14,22 @@ display: block; } -.code-content code > .line { +.code-content code > :global(.line) { display: block; min-width: 100%; padding-right: 1rem; } -.code-content code > .line:first-child { +.code-content code > :global(.line):first-child { padding-top: 0.5rem; } -.code-content code > .line:last-child { +.code-content code > :global(.line):last-child { padding-bottom: 0.5rem; } /* Line numbers via ::before pseudo-element */ -.code-content code > .line::before { +.code-content code > :global(.line)::before { content: attr(data-line-number); display: inline-block; width: 3rem; @@ -39,12 +39,3 @@ user-select: none; cursor: pointer; } - -/* Line highlighting */ -.code-content code > .line.highlighted { - background-color: rgba(255, 235, 59, 0.3); -} - -:global(.dark) .code-content code > .line.highlighted { - background-color: rgba(255, 235, 59, 0.15); -}