|
263 | 263 | /* Improved code block rendering */ |
264 | 264 | .message-text pre { |
265 | 265 | margin: 0.75em 0 !important; |
266 | | - padding: 0 !important; |
| 266 | + padding: 0 !important; /* Shiki adds its own padding */ |
267 | 267 | background-color: var(--vscode-textCodeBlock-background) !important; |
268 | 268 | border: 1px solid var(--vscode-widget-border) !important; |
269 | 269 | border-radius: 4px !important; |
|
285 | 285 | width: 100% !important; |
286 | 286 | max-width: 100% !important; |
287 | 287 | margin: 0.75em 0 !important; |
288 | | - padding: 0 !important; |
289 | | -} |
290 | | - |
291 | | -/* The actual syntax highlighted content */ |
292 | | -.react-syntax-highlighter-pre { |
293 | | - margin: 0 !important; |
294 | | - padding: 1em !important; |
295 | | - background-color: var(--vscode-textCodeBlock-background) !important; |
296 | | - border-radius: 4px !important; |
297 | | - width: 100% !important; |
298 | | - font-family: var(--vscode-editor-font-family) !important; |
299 | | - font-size: var(--vscode-editor-font-size) !important; |
300 | | - word-break: normal !important; |
301 | | - white-space: pre !important; |
302 | | - overflow-x: auto !important; |
303 | | - line-height: 1.5 !important; |
304 | | - tab-size: 4 !important; |
| 288 | + padding: 0 !important; /* Shiki adds its own padding */ |
305 | 289 | } |
306 | 290 |
|
307 | 291 | /* Ensure any code containers are full width */ |
|
313 | 297 | box-sizing: border-box !important; |
314 | 298 | } |
315 | 299 |
|
316 | | -/* Line numbers in code blocks */ |
317 | | -.linenumber { |
318 | | - color: var(--vscode-editorLineNumber-foreground) !important; |
319 | | - opacity: 0.7 !important; |
320 | | - padding-right: 0.5em !important; |
321 | | - text-align: right !important; |
322 | | - min-width: 3.5em !important; |
323 | | -} |
324 | | - |
325 | 300 | .message-actions { |
326 | 301 | display: flex; |
327 | 302 | justify-content: flex-end; |
|
713 | 688 | border: 1px solid var(--vscode-widget-border); |
714 | 689 | border-radius: 4px; |
715 | 690 | margin: 0.5em 0; |
716 | | - padding: 1em; |
| 691 | + padding: 1em; /* Keep padding for generic pre */ |
717 | 692 | overflow: auto; |
718 | 693 | width: 100% !important; |
719 | 694 | display: block !important; |
|
722 | 697 | /* Code blocks (pre > code) */ |
723 | 698 | .message-text pre>code { |
724 | 699 | display: block !important; |
725 | | - padding: 0.5em; |
| 700 | + padding: 0.5em; /* Keep padding for generic pre > code */ |
726 | 701 | overflow-x: auto; |
727 | 702 | white-space: pre; |
728 | 703 | background-color: var(--vscode-textCodeBlock-background) !important; |
|
734 | 709 | border: none; |
735 | 710 | } |
736 | 711 |
|
737 | | -/* Enhanced styles for SyntaxHighlighter component */ |
738 | | -.message-text .react-syntax-highlighter-line-number { |
739 | | - color: var(--vscode-editorLineNumber-foreground) !important; |
740 | | - opacity: 0.7; |
741 | | -} |
742 | | - |
743 | | -.message-text pre.prism-code { |
744 | | - margin: 1em 0 !important; |
745 | | - background-color: var(--vscode-textCodeBlock-background) !important; |
746 | | - border-radius: 4px !important; |
747 | | - border: 1px solid var(--vscode-widget-border) !important; |
748 | | - font-family: var(--vscode-editor-font-family) !important; |
749 | | - font-size: var(--vscode-editor-font-size) !important; |
750 | | - display: block !important; |
751 | | - width: 100% !important; |
752 | | - max-width: 100% !important; |
753 | | - overflow-x: auto !important; |
754 | | -} |
755 | | - |
756 | | -/* This ensures the React Syntax Highlighter wrapper respects width */ |
757 | | -.message-text div:has(> pre.prism-code) { |
758 | | - width: 100% !important; |
759 | | - max-width: 100% !important; |
760 | | - margin: 0 !important; |
761 | | - padding: 0 !important; |
762 | | -} |
763 | | - |
764 | | -/* Fix for code blocks showing extra unwanted padding */ |
765 | | -.message-text pre>code, |
766 | | -.message-text .react-syntax-highlighter-pre { |
767 | | - padding: 0.5em !important; |
768 | | - margin: 0 !important; |
769 | | - background: var(--vscode-textCodeBlock-background) !important; |
770 | | -} |
771 | | - |
772 | 712 | /* Inline code */ |
773 | 713 | .message-text code:not(pre code), |
774 | 714 | .message-text .inline-code, |
|
818 | 758 | width: auto !important; |
819 | 759 | } |
820 | 760 |
|
821 | | -/* For SyntaxHighlighter component */ |
822 | | -.message-text .prism-code { |
823 | | - background-color: transparent !important; |
824 | | - border-radius: 4px; |
825 | | - margin: 0.5em 0; |
826 | | - font-family: var(--vscode-editor-font-family) !important; |
827 | | - font-size: var(--vscode-editor-font-size) !important; |
828 | | -} |
829 | | - |
830 | 761 | /* Blockquotes */ |
831 | 762 | .message-text blockquote { |
832 | 763 | border-left: 3px solid var(--vscode-textBlockQuote-border); |
|
1340 | 1271 | font-size: 14px; |
1341 | 1272 | } |
1342 | 1273 |
|
1343 | | -/* Fix specific issues with syntax highlighting containers */ |
1344 | | -.message-text .react-syntax-highlighter-pre { |
1345 | | - margin: 0 !important; |
1346 | | - padding: 1em !important; |
1347 | | - border-radius: 4px !important; |
1348 | | - width: 100% !important; |
1349 | | - max-width: 100% !important; |
1350 | | - word-break: normal !important; |
1351 | | - white-space: pre !important; |
1352 | | - overflow-x: auto !important; |
1353 | | - font-family: var(--vscode-editor-font-family) !important; |
1354 | | - font-size: var(--vscode-editor-font-size) !important; |
1355 | | - line-height: 1.5 !important; |
1356 | | - tab-size: 4 !important; |
1357 | | -} |
1358 | | - |
1359 | | -/* Fix for the SyntaxHighlighter container */ |
1360 | | -.message-text pre.prism-code, |
1361 | | -.message-text pre.language-javascript, |
1362 | | -.message-text pre.language-typescript, |
1363 | | -.message-text pre.language-json, |
1364 | | -.message-text pre.language-python, |
1365 | | -.message-text pre.language-html, |
1366 | | -.message-text pre.language-css, |
1367 | | -.message-text pre[class*="language-"] { |
1368 | | - margin: 1em 0 !important; |
1369 | | - padding: 0 !important; |
1370 | | - background-color: var(--vscode-textCodeBlock-background) !important; |
1371 | | - border: 1px solid var(--vscode-widget-border) !important; |
1372 | | - border-radius: 4px !important; |
1373 | | - width: 100% !important; |
1374 | | - overflow-x: auto !important; |
1375 | | -} |
1376 | | - |
1377 | 1274 | /* Fix for ReactMarkdown container of code blocks */ |
1378 | 1275 | .message-text>div { |
1379 | 1276 | max-width: 100% !important; |
|
0 commit comments