How can I increase font size of inline code?

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

On my desktop, in the default theme of Obsidian inline-code is rendered tiny and ugly. (see screenshot)
default_inline_code_tiny

Is there a CSS-snippet or something else to improve the readability of inline-code?
It should increase font size, so that inline code has the same size as normal text.
At best, inline code should look like here in the forum.
I tried some other themes, but I wasn’t happy with them either.

Things I have tried

I asked ChatGPT. It suggested me to activate this as custom CSS:

/* Adjust the font size for inline code blocks */
.cm-s-obsidian span.cm-inline-code {
    font-size: 1.2em; /* You can change this value to your desired font size */
}

I applied a custom CSS with this code, but it didn’t change anything.

I searched in “share and showcase” for a solution, but I coudn’t find something appropriate for me.

Ohh, ChatGPT is learning. :hushed:

You could give this a try (it covers reading and editing views):

.markdown-rendered code,
.cm-s-obsidian span.cm-inline-code  {
    color: var(--code-normal);
    background-color: var(--code-background);
    font-size: inherit;
}

The inherit here can be changed to 1em or a 16px value.

I chose as font-size 1.2em. After applying the code as a snippet and enabling the snippet:
the fonts of inline code are larger in editing mode, but stay the same size in reading mode.

What theme are you using?

It is the theme “default” of Obsidian - base color scheme “light”.

Hm. Not sure. Using the above CSS, here I’m changing font-size: 1.0em:font-size: 1.3em and back.

  • Obsidian 1.3.5 (1.3.5)
  • default theme (light mode)
  • Live Preview mode (left) and reading mode (right)

CleanShot 2023-08-01 at 05.49.02

It’s possible some other CSS or a plugin is interfering. Does this snippet work in the Sandbox or a new vault?

1 Like

In a new sandbox vault, the snippet can adjust font size both in editing mode and reading mode. So there might be some plugin interfering. I will check the plugins of my regular vaults.

I removed the folder .obsidian and reinstalled all necessary plugins by downloading the current version.
On doing so, I couldn’t identify a trouble maker, but I’m happy with the result. :grinning:

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