Will be adding Selectors to this Post
Structure of Selectors
- Workspace
- Left Ribbon
- Right Ribbon
- Left Sidebar
- File Explorer
- Search
- Star Notes
- Notes Panes
- Main Content
- Title Bar
- Preview Mode
- Editor Mode
- Right Sidebar
- Collapse / Open Icon
- Tags Pane
- Back-links Pane
- Notes Pane
Understanding HTML Attributes
As Silver stated, workspace-leaf-content have a data-type (e.g. “markdown”) and they also have a data-mode="preview" when in preview mode (doesn’t look like there’s a data-mode for editor, not sure if intentional) within the main container, there is div with class .workspace which contains the ribbons ( .workspace-ribbon.side-dock-ribbon.mod-left and .workspace-ribbon.side-dock-ribbon.mod-right ), the sidebars ( .workspace-split.mod-left-split and .workspace-split.mod-right-split ) and the main “root” workspace ( .workspace-split.mod-root ). So, if you’re looking to target a note in a sidebar specifically, you’d probably be looking for something like .mod-left-split .worspace-leaf-content[data-type="markdown"]
32 Likes
@lizardmenfromspace Great job!! This will be super helpful.
There is a previous css guide from @Reggie, which can be put together here, although it is based on old version:
Graph View
/*background of graph view pane*/
.workspace-leaf-content[data-type = "graph"] .view-content{
background-color: var(--background-primary);
}
/*filled color for the circle when not hover*/
.graph-view.color-fill {
color: var(--background-secondary);
}
/*color for the circle stroke */
.graph-view.color-circle {
color: var(--text-normal);
}
/*color for the connecting line when not hover*/
.graph-view.color-line {
color: var(--background-modifier-border);
}
/*color for texts*/
.graph-view.color-text {
color: var(--text-normal);
}
/*filled color for the circle when hover*/
.graph-view.color-fill-highlight {
color: var(--interactive-accent);
}
/*color for the connecting line when hover*/
.graph-view.color-line-highlight {
color: rgb(var(--interactive-accent-rgb));
}
4 Likes
Kuncy
6
A little more descriptions for those unfamiliar with CSS, please?
4 Likes
Kuncy
7
Didn’t quite understand what this is supposed to mean 
1 Like
Hi, newbie to CSS here. I’m trying to change the color of the file extension in File Explorer. The dev window tells me it’s .nag-file-tag { } but I don’t see that in the obsidian.css file and can’t file it on the lists here either. Any idea how to edit it?
Hi, looking for selectors for the popover previews. Trying to eliminate the scroll bars on embeds showing in the popover preview, but can’t find the right selectors. Any info?
1 Like
rvc
14
hi. can anyone help me on why all my light themes are actually kind of yellowish but not true white? been fiddling with the css file and reading these posts but I’m getting nowhere… sorry if this isn’t the right place for this question, my first time on the forum.
Hey, rvc…did you resolve your issue?
Hi @lizardmenfromspace is there any way to add a background in the modal-bg?
I wanted to put a picture or some interesting animation when I open the settings menu. Just to relax.
tobei
17
How would you go about overriding the color of headers and links in reading views? Is the printing css the same as the reader ?
Klaas
18
@tobei: try this:
/* Change header color */
.markdown-preview-view h1 {
color: var(--text-accent); /* change to your preferred color */
}
As for links: external or internal?
1 Like
TheM8
19
Seems like a couple more tags appeared. For instance:
.theme-dark .graph-view.color-fill-tag {
color: #ff0000;
}
To change color of the ‘tag’ nodes on the graph. By the way, is there maybe separated css tag for labels of ‘tag’ nodes? I’ve changed color of the nodes with code posted above but would like to change labels color as well, bus cannot find any mentions of such option.
2 Likes
Is there any way to load custom CSS libraries (e.g. Augmented-UI <link rel="stylesheet" type="text/css" href="https://unpkg.com/augmented-ui@2/augmented-ui.min.css">) into themes?
For augmented UI, you usually have to load the stylesheet AND add “data-augmented-ui” value to the
in the HTML code, so you can address it in CSS.
Anyone got any idea how to achieve this?