browser-supports-log-styles
returns true if browser supports console log styling
Modern browsers support CSS-based styling of console log outputs. See Documentation on Mozilla Developer Network
Usage
Download latest version here: https://wzrd.in/standalone/browser-supports-log-stylesOr install via npm:
npm install -S browser-supports-log-styles
if (browserSupportsLogStyles()) {
console.log('%cLOG%c styling supported', 'color: white; padding: .2em .5em; border-radius: 1em; background-color: blue', 'color: inherit')
} else {
console.log('styling not supported')
}
Current Browser Support
- Chrome
- Safari
- Firefox >= v31