mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(code): fix styling for dark mode code block
This commit is contained in:
@@ -17,6 +17,24 @@ interface CodeProps {
|
||||
placeholder?: string
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
const styleId = 'code-dark-mode-fix'
|
||||
if (!document.getElementById(styleId)) {
|
||||
const style = document.createElement('style')
|
||||
style.id = styleId
|
||||
style.textContent = `
|
||||
.dark .token.operator {
|
||||
color: #9cdcfe !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
.dark .token.punctuation {
|
||||
color: #d4d4d4 !important;
|
||||
}
|
||||
`
|
||||
document.head.appendChild(style)
|
||||
}
|
||||
}
|
||||
|
||||
export function Code({
|
||||
blockId,
|
||||
subBlockId,
|
||||
|
||||
Reference in New Issue
Block a user