Add syntax highlighting themes for markdown preview

This commit is contained in:
2025-10-11 22:26:21 +02:00
parent aca127e52e
commit d582b1a1e9

View File

@@ -108,3 +108,29 @@ $navbar-height: 64px;
.tree { .tree {
padding-top: $padding; padding-top: $padding;
} }
// Syntax highlighting themes
@import 'highlight.js/styles/github.css' layer(light-theme);
@import 'highlight.js/styles/github-dark.css' layer(dark-theme);
// Show light theme by default
@layer light-theme {
[data-mantine-color-scheme='light'] .markdown-preview {
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
}
}
// Show dark theme in dark mode
@layer dark-theme {
[data-mantine-color-scheme='dark'] .markdown-preview {
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
}
}