I would like to set css specific for certain pages/notes. How to do that?
More detailed: I have built a weekly template to set weekly notes (Periodic Notes + Calendar plugin). This template adds links to the 7 daily notes, but since I’ve also created notes in folder ‘daily’ that don’t follow the exact naming rule of ‘daily notes’ I added an embedded search query to the template that embeds links to the notes that also belong to that week.
That works fine, but I don’t want to see the default markup. So I created a CSS snippet that changes the CSS for just the embedded query + result, but I want to apply it to just these weekly notes, not the entire vault.
Hi @hepabolu, you can do this by adding the cssclass property to your YAML frontmatter. So in your weekly note template, you could add the following to the top of the note:
---
cssclass: "weekly-note"
---
Then in your CSS snippet, make sure to only target pages with the .weekly-note class.
Hope that helps, and if you don’t mind sharing, I’d love to see a screenshot since I’m curious about how people use their weekly notes!
Hi @liam thanks! This will get me exactly what I need!
Re weekly notes: I use them as a mini TOC for the week, that ties meeting notes and daily notes together.
---
created: {{tp_date}} {{tp_time}}
tags: 📥/🗒
---
# {{title}}
## Daily Notes
- [[{{monday:GGGG-MM-DD}}]]
- [[{{tuesday:GGGG-MM-DD}}]]
- [[{{wednesday:GGGG-MM-DD}}]]
- [[{{thursday:GGGG-MM-DD}}]]
- [[{{friday:GGGG-MM-DD}}]]
- [[{{saturday:GGGG-MM-DD}}]]
- [[{{sunday:GGGG-MM-DD}}]]
## Meetings
\```query
path: meetings (file:/{{monday:GGGG-MM-DD}}[ ].*/ OR file:/{{tuesday:GGGG-MM-DD}}[ ].*/ OR file:/{{wednesday:GGGG-MM-DD}}[ ].*/ OR file:/{{thursday:GGGG-MM-DD}}[ ].*/ OR file:/{{friday:GGGG-MM-DD}}[ ].*/ OR file:/{{saturday:GGGG-MM-DD}}[ ].*/ OR file:/{{sunday:GGGG-MM-DD}}[ ].*/)
\```
The YAML frontmatter is using the default Templater tokens and a tags system based on @tallguyjenks system.
So the top part are the daily notes which I use for any snippet of information that I want to save but don’t yet know how it fits in the system. They live in a ‘daily’ subfolder.
I have a lot of meetings where I take notes, so I store these in a separate subfolder ‘meetings’ and they al start with a YYYY-MM-DD prefix, followed by a space and a name of the meeting.
This helps to see which meetings I had in a certain week and possibly which other notes I took.
I reserve the root folder for the more Zettelkasten type notes and MOCs.
Your selector looks for a class root after or below your test class and only works on the content within that section.
I’m not sure if such a situation exists. Try testing without the .root and see what happens.