Need help to change the size of headings, in default theme, in live preview, using CSS snippet

Things I have tried

I’ve tried altering the point size in this snippet section. It works, but only in viewing mode. I do 99% of my work in preview mode. In viewing mode there is no change.

.markdown-preview-view h1 {
font-size: 27pt ;}

What I’m trying to do

I want to be able to control the size of headers in live preview mode.

I have zero knowledge of CSS other than how to copy and paste suggestions and alter obvious variables like “pt”. I also have at this time in my life, no time to learn CSS due to other demands on my time.

add this snippet to your css snippet file. this code uses obsidian default css variables e.g. --h2 to control the font size. this will affect both editing/source mode, editing/live preview and reading view. change the size according to your preferences

	body {
		/* these are obsidian app.css variables */
		--h1: 1.40rem;
		--h2: 1.40rem;
		--h3: 1.25rem;
		--h4: 1.05rem;
		--h5: 1.00rem;
		--h6: 1.00rem;

reference if u need to know how to add snippets

1 Like

This worked right away and was very helpful. Thanks

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.