If one goes to Facebook and opens the console they'll see input such as this:
How does Facebook achieve this styled text? Also, unlike a normal console.log
, etc. there is no script.js:123
reference in the console. This is Chrome 56.
If one goes to Facebook and opens the console they'll see input such as this:
How does Facebook achieve this styled text? Also, unlike a normal console.log
, etc. there is no script.js:123
reference in the console. This is Chrome 56.
Please Refer to this for examples on how to add colors to console: Colors in JavaScript console
In short :
With Chrome & Firefox (+31) you can add CSS in JS console.log()
messages:
console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');