MarkdownLivePreview icon indicating copy to clipboard operation
MarkdownLivePreview copied to clipboard

Change default CSS

Open dialectstudio opened this issue 1 year ago • 2 comments

Hello, What is the variable to change the default CSS? Is it to be written in MarkdownLivePreview.sublime-settings? For example, I'd like to change the font used in the preview.

dialectstudio avatar Jan 27 '24 17:01 dialectstudio

I have the exact same issue, @dialectstudio did you ever end up figuring it out?

plutonium-239 avatar Sep 09 '25 13:09 plutonium-239

Since the CSS is at MarkdownLivePreview/resources/stylesheet.css, we can make a file stylesheet.css in the Packages/ folder of sublime text (preferences > browse packages). (By default when you install through Package Control, it installs it in the Installed Packages/ folder, all the files here are .sublime-packages, which is just a ZIP file)

Essentially, you are overriding that file.

%APPDATA%/Sublime Text
|- Installed Packages
|  |- MarkdownLivePreview.sublime-package
|- Packages
|  |- MarkdownLivePreview
|      |- resources
|          |- stylesheet.css

and in this new file copy the contents of the original file and change the body's font-family to whatever you wish.

So, when the package updates, the .sublime-package will be updated, but your new file will stay the same, and you might not see the update. But since the last update here was 6 years ago...

It is a hacky solution, but the only one for now

plutonium-239 avatar Sep 09 '25 13:09 plutonium-239