Obsidian: Use pinned notes to enhance your workspace
Community plugins often position informative panels in Obsidian’s left and right sidebars. I use pinned sidebar notes to add my own panels to my workspace and keep reference information close at hand. This article details how you can do the same.
🪄 Create the Note
The first thing you need to do is create your reference note.
Let’s say you want to pin a contact list. Your note might look like this:
---
cssclasses: pinned-contacts
---
# Contacts
## Mann, Milk
- (123) 876-6543
- dude@dairy.place
## Rabbit, Jessica
- @cartoon@live.world
This is the regular note, but notice the cssclasses
frontmatter tag at the top. This will be useful later. You don’t have to use pinned-contacts
for the class name — pick something that will be unique to this note.
📌 Pinning the note
To pin the note, put it in Reading
mode, drag it to the sidebar and drop it where you want it. Right-click the note’s tab icon and select Pin
. Pinning the tab ensures that any links in your sidebar note will open into a new tab in the main part of the workspace. If you don’t pin the note and you click on a link, the linked file will replace the note in the sidebar, and you will have to do this whole process again.
🥷 Blending In
After all this, you have a note in Reading
mode pinned to your sidebar. It sticks out like a sore thumb and can be distracting. Now we need to blend it with the rest of Obsidian’s interface. This is my favorite part!
Create a new CSS snippet
By creating a CSS snippet, you can control how Obsidian presents itself. Follow these steps:
- Open
Settings
. - Under
Appearance > CSS snippets
, selectOpen snippets folder
(folder icon). - In the snippets folder, create a CSS file (e.g., name.css) that contains your snippet.
- In Obsidian, under
Appearance > CSS snippets
, selectReload snippets
(refresh icon) to see the snippet in the list. - In Obsidian, click the toggle next to the CSS file you created to activate it.
Tell Obsidian what you want
Open the new snippet in a text editor. We will add some code to the snippet, but don’t worry! This won’t break Obsidian or mess anything up. If you get stuck or things don’t look the way they should, you can deactivate the snippet in Obsidian’s Settings
under Appearance > CSS snippets
.
Add the following code to the snippet:
/* Use the interface font */
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts,
.mod-right-split .markdown-preview-view.markdown-rendered.pinned-contacts {
font-family: var(--font-interface);
}
/* style headings */
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts h1,
.mod-right-split .markdown-preview-view.markdown-rendered.pinned-contacts h1 {
margin-top: 0;
margin-bottom: 6px;
font-size: 1.125em;
}
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts h2,
.mod-right-split .markdown-preview-view.markdown-rendered.pinned-contacts h2 {
margin-block-start: .25em;
margin-bottom:0;
font-size: 1em;
}
/* spacing of unordered lists*/
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts div.el-ul,
.mod-rightt-split .markdown-preview-view.markdown-rendered.pinned-contacts div.el-ul {
margin-block-start: 0;
margin-block-end: 0;
margin-inline-start: 0;
margin-inline-end: 0
}
/* color */
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts,
.mod-right-split .markdown-preview-view.markdown-rendered.pinned-contacts,
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts h1,
.mod-right-split .markdown-preview-view.markdown-rendered.pinned-contacts h1,
.mod-left-split .markdown-preview-view.markdown-rendered.pinned-contacts h2,
.mod-right-split .markdown-preview-view.markdown-rendered.pinned-contacts h2 {
color: var(--text-muted)
}
You should change every occurrence of pinned-contacts
in the code to whatever class name you used for your note in itscssclasses
frontmatter.
Now save the note and look at your pinned sidebar note — it should look like part of Obsidian’s interface.
I should point out that the CSS code above is designed for Obsidian’s default theme. If you use a community theme, you will likely need to alter the snippet to match.
👀 A screenshot
This is what the final product will look like.
💬 One final word
You might notice that the pinned note’s icon isn’t very helpful — it would be great if each pinned sidebar note had a meaningful icon.
The good news is that this can be remedied. The process is a bit involved and requires even more coding, so I will publish the solution in a separate article. Leave feedback below to let me know you are interested.