Skip to content

Instantly share code, notes, and snippets.

@jakub-g
Last active February 18, 2021 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakub-g/b75334cfa5906dc09b3c4e1b7a1da89c to your computer and use it in GitHub Desktop.
Save jakub-g/b75334cfa5906dc09b3c4e1b7a1da89c to your computer and use it in GitHub Desktop.
In-browser multi colored output in a single console.log
// https://developer.mozilla.org/en-US/docs/Web/API/Console#Styling_console_output
// https://github.com/mdn/content/pull/2444
console.log('%cCOLORED1%cCOLORED2', 'color:white;background:purple;', 'color:white;background:red;' , 'unformatted')
console.log('%cone%ctwo', 'border-radius:2px;padding:1px 3px;margin:0 1px;color:white;background:darkblue;', 'border-radius:2px;padding:1px 3px;margin:0 1px;color:white;background:rebeccapurple;', 'message')
@jakub-g
Copy link
Author

jakub-g commented Feb 18, 2021

image

@jakub-g
Copy link
Author

jakub-g commented Feb 18, 2021

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment