Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the built-in Markdown CSS files in Visual Studio Code?

Visual Studio Code has a built-in Markdown previewer. A theme can be selected in the preview window by right-clicking and choosing Preview Theme and selecting from various CSS options such as github-light.css, none.css, etc.

I would like to use some of these CSS files as a starting point for my own Markdown preview CSS. Where are these CSS files located and how may one access them?

like image 428
Halcyon Avatar asked Apr 27 '26 23:04

Halcyon


1 Answers

On my Windows machine, it looks like the CSS file that controls the styling is in C:\Program Files\Microsoft VS Code\resources\app\extensions\markdown-language-features\media. The file is called markdown.css. Sure enough, when I change some of the values around, I see the preview window (after closing and reopening it, or switching tabs) update with the specified changes.

Within this file are multiple "Theming" classes, which I suspect are what get referenced when you switch themes, rather than having multiple .css files per theme:

/** Theming */

.vscode-light pre {
    background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
    background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
    background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
    border-color: rgb(0, 0, 0);
}

.vscode-light th {
    border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark th {
    border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light td {
    border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark td {
    border-color: rgba(255, 255, 255, 0.18);
}
like image 104
Timothy G. Avatar answered Apr 30 '26 12:04

Timothy G.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!