Customize inline code block background and font colors in all pages and spaces

Hello,

I want to have inline code blocks (called monospaced text in editor) to have background color and font color different from default. I need it on css level, so it will be applied to all pages and spaces (unless customized otherwise in editor).

I think it would require adding custom css snippet but I can't find where I should put it. Css like:

code {
  background-color: #e67300;
  color: #333;
}

1 answer

Hi Alex,

Unfortunately with OnDemand you cannot add your own custom CSS as all of the entry points that would allow you to do this in the download version (HTML Macro, User Macro, Custom Themes, Custom HTML, Space Layout, etc.) are restricted with OnDemand to avoid potential security or stability problems that custom HTML/CSS/Javascript could cause.

Only think I can think of is if one of the pre-defined themes for the Code Macro (http://confluence.atlassian.com/display/DOC/Code+Block+Macro) is close to what you want then encourage users to use that particular formatting when entering code blocks.

Far from ideal for what you want to do I know, but is this of some help?

Andrew.

Hey there Confluence team. Its been six years since this (and many more of the same nature in other threads) request to be able to use Confluence for in-line code highlighting. There are a large number of challenges with the current editor usability, to a point that it is just not useful.

1) Back-ticks will change the font of a some text to Monospace, but the industry standard for in-line highlighting is some form of grayed out style. Monospace is not a good choice for inline code and we would like you to adhere to the standard.

2) Above option does not work if you choose Monospace from the menus (it will change the whole sentence and not just the selected words.

3) When one uses two back-ticks the editor will auto-change the font immediately. This is not useful, we would like it to retain, while editing, the two back-ticks because then we can revert it to regular text or add more text inside the two back-ticks. Only when the page is viewed the back-ticks should go again (and be available again if we enter edit mode).

Thanks for reading, I hope you do something about it after so many years,

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,099 views 17 14
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you