Skip to content

Commit 68a7c4c

Browse files
avivkellerjcbhmr
andcommitted
util: add CSS support to formatting
Co-Authored-By: Jacob Hummer <jcbhmr@outlook.com> Signed-off-by: Aviv Keller <me@aviv.sh>
1 parent fd6682c commit 68a7c4c

4 files changed

Lines changed: 521 additions & 7 deletions

File tree

‎doc/api/util.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ console.log(diff('same', 'same'));
458458
<!-- YAML
459459
added: v0.5.3
460460
changes:
461+
- version: REPLACEME
462+
pr-url: https://github.com/nodejs/node/pull/65942
463+
description: The `%c` specifier is supported now.
461464
- version: v12.11.0
462465
pr-url: https://github.com/nodejs/node/pull/29606
463466
description: The `%c` specifier is ignored now.
@@ -516,7 +519,9 @@ corresponding argument. Supported specifiers are:
516519
* `%O`: `Object`. A string representation of an object with generic JavaScript
517520
object formatting. Similar to `util.inspect()` without options. This will show
518521
the full object not including non-enumerable properties and proxies.
519-
* `%c`: `CSS`. This specifier is ignored and will skip any CSS passed in.
522+
* `%c`: `CSS`. Applies provided CSS. Supported CSS properties are `color`,
523+
`background-color`, `background`, `font-weight`, `font-style`, `text-decoration`,
524+
`text-decoration-line`, and `text-decoration-color`.
520525
* `%%`: single percent sign (`'%'`). This does not consume an argument.
521526
* Returns: {string} The formatted string
522527

0 commit comments

Comments
 (0)