http://www.perlmonks.org?node_id=1007451

It may not be for everyone, but the way inline code and code blocks are displayed with a border and distinct background color on many sites really helps me when reading text interspersed with code. After reading Repainting the Monastery the other day, I decided to spend an evening learning some basic CSS so that I could make my own PerlMonks experience more pleasant.

Below is the modest CSS snippet I'm currently testing out. I also put it up as a GitHub gist so that I can point to it from Display Settings (for anyone that doesn't know where to add CSS code or point to external CSS links).

tt.codetext, tt.inlinecode { border: 1px solid gray; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; font-family: Mensch,Menlo,Monaco,Consolas,"Courier New",monospace; white-space: pre; color: black; background-color: #FFF4F4; word-wrap: break-word; } tt.codetext { display: block; margin-right: 5px; padding: 4px 4px 4px 4px; font-size: 100%; line-height: 13px; } tt.inlinecode { padding: 2px 1px 2px 1px; font-size: 60%; line-height: 15px; } @media screen and (max-device-width:480px) { tt.inlinecode { font-size: 100%; } }

I use PM's red theme, so I gave my code blocks a faint red color to keep with the theme; however, this background color can easily be changed by adjusting background-color: #FFF4F4;. There are a couple other things I'm debating, including whether I prefer it without word-wrap: break-word;, but I figured I'd post it here in hopes that someone might find it useful and that other people might also share any nice CSS customizations they have done.

On the theme of sharing... If there are many people with custom PerlMonks CSS, it might be nice to have a node dedicated to snippets or external links to supplement the primary themes that are available in Display Settings. This might help quench some people's thirsts for a 'repainted' monastery, without actually having to do any real painting.

EDIT: I posted screenshots of how it looks on my screen with and without this CSS.

EDIT #2: Added a bit so that things look as expected when viewing PM from my phone.