Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code Markdown preview styles

I know how to use markdown-styles in settings to supply my own CSS for styling Markdown previews, but I don't know what elements and CSS classes to style. Are the ones used in Markdown preview documented somewhere?

like image 700
Mark Volkmann Avatar asked Apr 02 '18 21:04

Mark Volkmann


2 Answers

  1. Open a Markdown file.
  2. Open the split preview window (Cmd + K, V on Mac, or the split view icon in the upper right-hand corner of the window, or open the command palette (menu ViewCommand Palette or Shift + Cmd + P on Mac) and run Markdown: open Preview to the side.
  3. Open the command palette and run Developer: Open WEBVIEW developer tools.
  4. That will open a browser-like inspector, and you can drill down and see whatever you need there.

Note that Toggle Developer Tools in the Help menu does not work for this — it does not drill down into the Preview's webview window.

like image 83
vr8ce Avatar answered Sep 27 '22 22:09

vr8ce


You can use vr8ce’s helpful answer to find the source of the default stylesheet. On the Mac, this is the path:

/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/extensions/markdown-language-features/media/markdown.css

like image 23
charles Avatar answered Sep 27 '22 22:09

charles