Custom CSS (font size) for a single note in preview mode

Things I have tried

What I’m trying to do

Is it possible to use custom-CSS for just one note? What I’m trying to do is to have a small font size for my Tasks page — which I dock to the sidebar in preview mode. Any other solutions, apart from the custom-CSS, to do this is also most appreciated!

Thank you!

You can create a specific cssclass in yaml frontmatter and apply it only in the notes you want.
For example:

  1. define cssclass in yaml frontmatter (top of the page)
---
cssclass: taskspage
---
  1. Create your css snippet for that taskspage class
/* for generic text */
.markdown-preview-view.taskspage {
  font-size: 11px;
}

/* for heading h1 */
.markdown-preview-view.taskspage h1 {
  font-size: 15px;
}

/* ... */
3 Likes

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