Skip to content

Commit 0e1b164

Browse files
committed
add docs
1 parent a7a8bbe commit 0e1b164

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

doc/api/console.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ changes:
118118
streams. **Default:** `true`.
119119
* `colorMode` {boolean|string} Set color support for this `Console` instance.
120120
Setting to `true` enables coloring while inspecting values. Setting to
121-
`false` disables coloring while inspecting values. Setting to
122-
`'auto'` makes color support depend on the value of the `isTTY` property
123-
and the value returned by `getColorDepth()` on the respective stream. This
124-
option can not be used, if `inspectOptions.colors` is set as well.
121+
`false` disables coloring while inspecting values as well as disabling `%c`
122+
CSS color effects. Setting to `'auto'` makes color support depend on the
123+
value of the `isTTY` property and the value returned by `getColorDepth()` on
124+
the respective stream. This option can not be used, if
125+
`inspectOptions.colors` is set as well.
125126
**Default:** `'auto'`.
126127
* `inspectOptions` {Object} Specifies options that are passed along to
127128
[`util.inspect()`][].

doc/api/util.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,13 @@ corresponding argument. Supported specifiers are:
302302
* `%O`: `Object`. A string representation of an object with generic JavaScript
303303
object formatting. Similar to `util.inspect()` without options. This will show
304304
the full object not including non-enumerable properties and proxies.
305-
* `%c`: `CSS`. This specifier is ignored and will skip any CSS passed in.
305+
* `%c`: `CSS`. Will parse basic CSS from the substitution subject like
306+
`color: red` into ANSI color codes. These codes will then be placed where the
307+
`%c` specifier is. Supported CSS properties are `color`, `background-color`,
308+
`font-weight`, `font-style`, `text-decoration`, `text-decoration-color`, and
309+
`text-decoration-line`. Unsupported CSS properties are ignored. An empty
310+
`%c` CSS string substitution will become an ANSI style reset. If color is
311+
disabled, `%c` is ignored.
306312
* `%%`: single percent sign (`'%'`). This does not consume an argument.
307313
* Returns: {string} The formatted string
308314

0 commit comments

Comments
 (0)