From cfe2f126e59eed870e2978ebd263be9ca1be01a3 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 16 Mar 2021 17:16:20 -0300 Subject: [PATCH] Documentation only jsconsole (#17384) Co-authored-by: Danil Yarantsev Co-authored-by: Timothee Cour --- lib/js/jsconsole.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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