My dutifully crafted custom obsidian.css seems to kill Obsidian’s custom CSS capability. I have no idea what in here is causing the problem. I’ve tried to isolate the offending code. All the ideas in here are grabbed from other themes. I’m just posting here because I don’t know what else to do with this.
When this theme is activated, the only customization are
Editor window
- Heading underlines across whole page
Preview window:
- Heading suffix symbol
- Normalized font size for headings
- Nested list padding
Things that don’t seem to work at all:
- Most font colors
- Font sizes in Edit window
- Default body font sizes
- Font style/family
So far my experience is that I can activate a community theme. And that will work. And if I then copy my CSS into the community generated CSS file, my customization will work but then will stop on it’s own at some future date. It will also stop working if I make any changes to something like a color code in the obsidian.css.
The problem shows on two different computers of mine. They are running different builds of windows 10.
If I uninstall and scrub by system of all obsidian files. Then reinstall with v0.6.7, the problem persists.
The issue first showed itself in v0.6.5. And I temporarily fixed it by building my CSS file again, piece by piece from scratch. I never had the problem before v065. Other than that, I have no idea if it’s related to version.
I reduced my CSS down to a very small set of changes and tried to resolve it on discord, where I used someones else’s working CSS code but it would not work on either of my installations. At that point it just seemed too strange.
The only thing I can think of is that there’s something in this CSS that trips Obsidian up enough to not recognized edits in CSS unless it is drastically replaced with a completely different them from the community.
I don’t know if any of this is helpful but I figured that I should at least document it as much as I could.
.theme-dark {
--background-primary: #2f3136;
--background-primary-alt: #36393f;
--background-secondary: #202225;
--background-secondary-alt: #0c1018d1;
--text-normal: #bbc0c5;
--text-faint: #a09b80;
--text-link: #59a2c5;
--text-a: #59a2c5;
--text-a-hover: #b3a14b;
--text-mark: #d79921;
--pre-code: #272524d9;
--text-highlight-bg: rgba(255, 255, 0, 0.2);
--interactive-accent: #92A1A1;
--interactive-before: #5e6565;
--background-modifier-border: #92a1a17a;
--blockquote-border: rgba(77, 60, 166, .6);
--text-accent: #ff9640ba;
--interactive-accent-rgb: #fe8019;
/* Gabe Mods */
--text-color-code: #c9655e;
--text-title-h1: #a79645;
--text-title-h2: #939bd6;
--text-title-h3: #ba6ea0;
--text-title-h4: #b78b60;
--text-title-h5: #859679;
--text-title-h6: #95a679;
--text-muted: #888;
--text-faint: #555;
--font-heading-normaized: 22px;
--heading-symbol-size: 16px;
--font-family-editor: Candara;
--font-family-preview: Candara;
}
/******************/
/* editor section */
/******************/
/* normal text outside of headings and code */
.cm-s-obsidian
{
font-family: var(--font-family-editor);
font-size: 15px;
}
.mod-single-child .cm-s-obsidian
{
font-family: var(--font-family-editor);
font-size: 15px;
color: var(--text-normal);
}
/* code color */
.cm-s-obsidian span.cm-inline-code {
color: var(--text-color-code);
}
/*## headings ##*/
/* Universal Mods */
/* Allows for full page header underline to define sections more clearly */
.cm-s-obsidian pre.HyperMD-header {
line-height: 1.4 !important;
border-bottom: thin solid var(--text-faint);
}
.cm-header-1,
.cm-header-2,
.cm-header-3,
.cm-header-4,
.cm-header-5,
.cm-header-6
{
font-family: var(--font-family-editor);
/* font-weight: 500; */
/* font-weight: bold; */
/* border-bottom: thin solid var(--text-faint); */
}
/* Individual Mods */
.cm-header-1
{
font-size: var(--font-heading-normaized);
color: var(--text-title-h1);
}
.cm-header-2
{
font-size: var(--font-heading-normaized);
color: var(--text-title-h2);
}
.cm-header-3
{
font-size: var(--font-heading-normaized);
color: var(--text-title-h3);
}
.cm-header-4
{
font-size: var(--font-heading-normaized);
color: var(--text-title-h4);
}
.cm-header-5
{
font-size: var(--font-heading-normaized);
color: var(--text-title-h5);
}
.cm-header-6
{
font-size: var(--font-heading-normaized);
color: var(--text-title-h6);
}
/******************/
/* preview section */
/******************/
/* normal text outside of headings and code */
.markdown-preview-view
{
font-family: var(--font-family-preview);
font-size: 15px;
color: var(--text-normal);
/* padding-left: 10% !important; */
/* padding-right: 10% !important; */
}
.mod-single-child .markdown-preview-view
{
font-family: var(--font-family-preview);
font-size: 15px;
color: var(--text-normal);
/* padding-left: 20% !important; */
/* padding-right: 20% !important; */
}
/* code color */
.markdown-preview-view code {
color: var(--text-color-code);
}
/* headings */
.markdown-preview-view h1
{
font-family: var(--font-family-preview);
font-weight: 500;
font-size: var(--font-heading-normaized);
font-weight: bold;
color: var(--text-title-h1);
}
.markdown-preview-view h2
{
font-family: var(--font-family-preview);
font-weight: 500;
font-size: var(--font-heading-normaized);
font-weight: bold;
color: var(--text-title-h2);
}
.markdown-preview-view h3
{
font-family: var(--font-family-preview);
font-weight: 500;
font-size: var(--font-heading-normaized);
font-weight: bold;
color: var(--text-title-h3);
}
.markdown-preview-view h4
{
font-family: var(--font-family-preview);
font-weight: 500;
font-size: var(--font-heading-normaized);
font-weight: bold;
color: var(--text-title-h4);
}
.markdown-preview-view h5,
{
font-family: var(--font-family-preview);
font-weight: 500;
font-size: var(--font-heading-normaized);
font-weight: bold;
color: var(--text-title-h5);
}
.markdown-preview-view h6
{
font-family: var(--font-family-preview);
font-weight: 500;
font-size: var(--font-heading-normaized);
font-weight: bold;
color: var(--text-title-h6);
}
/* Header Suffix by Gabe*/
/* There's a (U+3000) space character before the ❶*/
h1::after
{
content: ' ❶';
font-size: var(--heading-symbol-size);
color: var(--text-muted);
}
h2::after
{
content: ' ❷';
font-size: var(--heading-symbol-size);
color: var(--text-muted);
}
h3::after
{
content: ' ❸';
font-size: var(--heading-symbol-size);
color: var(--text-muted);
}
h4::after
{
content: ' ❹';
font-size: var(--heading-symbol-size);
color: var(--text-muted);
}
h5::after
{
content: ' ❺';
font-size: var(--heading-symbol-size);
color: var(--text-muted);
}
h6::after
{
content: ' ❻';
font-size: var(--heading-symbol-size);
color: var(--text-muted);
}
/* ### Bullet Style ### */
ol {
padding-inline-start: 18px;
}
ul {
padding-inline-start: 18px;
list-style-type: disc;
}
/* ### Checklist Style correction from Bullet Style changes### */
.markdown-preview-view .task-list-item {
margin-left: -.2em;
}
/* Embeds */
.markdown-embed-title { display:none; }
.markdown-preview-view .markdown-embed { padding:0; margin:0; }
.markdown-preview-view .markdown-embed-content { max-height: unset;}
.markdown-preview-view .markdown-embed-content>:first-child { margin-top: 0; }
.markdown-preview-view .markdown-embed-content>:last-child { margin-bottom: 0; }