Could you support using a dark-mode code block theme even in light-mode themes?
Just like the webpage below.
Sure, I can do that. Do you think the other case (dark mode theme with light mode code block) is also something anyone would want?
Thank you for your prompt reply. I haven't actually encountered this situation(dark mode theme with light mode code block) on the webpage.
There's something I'd like to ask: why is it that after configuring the JSON file as you suggested, I still can't customize the SVG icon as expected?
{
"languages": [
{
"codeblockLanguages": ["language1", "language2"],
"displayName": "iRule",
"svgFile": `<path d="M25.089,11.822H18.7L15.267,8.388V2H6.911v8.357H13.3l3.422,3.422h0v4.431h0l-3.434,3.434H6.911V30h8.357V23.612h0L18.7,20.178h6.388ZM9.7,4.786h2.786V7.571H9.7ZM12.482,27.2H9.7V24.417h2.786Z" style="fill:#ffae1a"/>`
}
]
}
Thank you so much.! 😊
Because svgFile should be a filename not the actual svg, and that file contains the svg ;) Here is the snipper from the RADME:
{
"languages": [
{
"codeblockLanguages": ["language1", "language2"],
"displayName": "iRule",
"svgFile": "f5.svg",
"format": "tcl"
}
]
}
How can I do it?(light mode theme with dark mode code block ) I wanna change text color into white
@PrayerLi This is unfortunately a little more complex than I first thought. I implemented a toggle to force the code blocks to use the dark mode colors when using a light theme, however this results in unreadable text. This is a normal codeblock when using light theme, with simple text:
The same code block looks like this, when I force it to use the dark colors when using a light theme:
You can barely see the text. Of course, if I have written normal code, there would be some parts of it, which are still readable. This happens, because Obsidian still has the light colors set in the body as CSS variables. The code just uses those variables.
The point is, that since themes can also specify their own colors, and I have no clue who uses which theme, I can't do it.
What I could do, is the following: I can leave the toggle, BUT in this case it would be your (any other users) responsibility who wants to use this option, to create a small CSS snippet, which defines which colors to use.
Do you still want this option implemented this way?