diff --git a/lib/js/jsconsole.nim b/lib/js/jsconsole.nim index 8b0bc26209..b8a361af14 100644 --- a/lib/js/jsconsole.nim +++ b/lib/js/jsconsole.nim @@ -9,6 +9,18 @@ ## Wrapper for the `console` object for the `JavaScript backend ## `_. +## +## Styled Messages +## =============== +## +## CSS-styled messages in the browser are useful for debugging purposes. +## To use them, prefix the message with one or more `%c`, +## and provide the CSS style as the last argument. +## The amount of `%c`'s must match the amount of CSS-styled strings. +## +runnableExamples("-r:off"): + console.log "%c My Debug Message", "color: red" # Notice the "%c" + console.log "%c My Debug %c Message", "color: red", "font-size: 2em" import std/private/since, std/private/miscdollars # toLocation