Inline code is hard to see

Inline code in Discourse’s markdown rendered is hardly discernible. Here’s a sequence of the word code with code formatting in every other occurrence: code code code code. It’s very hard to tell the difference.

Compare for instance with how it shows on Stack Overflow:

And it’s even more obvious on Slack.

How would one go about changing this so that inline code is noticeable?

You can add something like this to your theme’s CSS:

p>code, li>code, pre>code {
    background: #dcdcdc;

Customize → Themes → Edit CSS/HTML


Thanks! I’ll let the relevant people know about this. I’ll let you know.

It seems that this changes both regular code blocks and inline code. Is there a way to just change inline code?

Code blocks are fine, they don’t need more emphasis, in my opinion:

import this

Not easily. You could try to target it with CSS attribute selectors… maybe.

A code block will look like this:

    <code>some code</code>

and inline code looks like this:

    "Lorem ipsum "
    <code>some code</code>
     " dolor sit amet."

The difference is in the quote marks.

But, wouldn’t you want to be consistent and have both with the same background?

1 Like

Thanks for all the help.

The discourse community my team manages is tied to our product and in our product, we aren’t consistent between these two types of code rendering. We use Slack’s style.

How do I go about marking this post as solved? I can’t for the life of me figure this out.


Only some of our categories have the solved button enabled. I just recategorized this to #support, you should be able to pick a solution now.

1 Like

Thanks, Sam. I see a solution button in your reply, but not on the reply which I wish to mark as a solution.

I also see it in my two replies to the linked post.

@sam How can I mark the linked reply as a solution. As an alternative, how do I mark any of omarfilip’s replies as a solution?

1 Like

I think its an edge case around live reloading, a full reload of the page would bring state to a … hmmm … good state.

I marked it as a solution for you.


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