Console Styles

Adding css to console.log messages is actually really simple and is supported by most browsers, I've tested it in the latest versions of firefox, chrome, safari and opera (on mac). They all worked fine and seem to support all css3 properties so you can go mad if you like but I've kept the demo fairly tame. Some browsers seem to have difficulty using fonts imported through css using @import. The best thing to do here is provide a good font stack.

Creating the styles

var consoleStyles = [
	'font-family: Roboto, Avant Garde,Avantgarde,Century Gothic,CenturyGothic,AppleGothic,sans-serif',
	'font-size: 16px',
	'color: #454545'
].join(';');

Applying the styles

console.log("%cFonts and colours in console.log messages", consoleStyles);
Screen shot

Just as a side note, adding asccii art to the console works in all the same browsers listed above except safari which for some reason seems to mess with letter spacing, even without changes to the style.