Is there a way of checking to see if a browser is capable of using console colors without sniffing?
console.log(\'%c Oh my heavens! \', \'background: #222; color
I wrote Console.js https://github.com/icodeforlove/Console.js to allow us to do this a bit easier
Console.styles.register({
red: 'color: red',
underline: 'text-decoration: underline',
bold: 'font-weight: bold'
});
then you can just do this
console.log('red text '.red + 'red underlined text'.red.underline + 'red bold text'.red.bold);
it will gracefully degrade like this