Closed Bug 1579197 Opened 6 years ago Closed 6 years ago

document which CSS is supported for %c styling

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pomax, Unassigned)

Details

(Keywords: dev-doc-complete)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36

Steps to reproduce:

I've been trying to find any documentation on which CSS properties can, and cannot, be used for styled console.log text using the %c syntax, and while the MDN docs for console.log mention that %c exists, there is zero information on what it actually supports.

Could someone who knows where the list of supported properties lives in the tree update the console.log MDN article to include which properties are/are not supported?

Yes, MDN team can hopefully help with this.

Flags: needinfo?(cmills)
Keywords: dev-doc-needed

Here's the regex we use for the allowed properties:

devtools/client/webconsole/components/Output/GripMessageBody.js#91-96

Priority: -- → P3

I've had a go at doing this:

https://developer.mozilla.org/en-US/docs/Web/API/Console#Styling_console_output

Let me know what you think.

I tested pretty much all of the properties that the regex would match, but I missed out a couple of bits that really don't look like they have any discernable effect. The main ones that come to mind are transition (you can't enter a state for the logged message such as :hover, so how would this do anything?) and (min|max)-width|height — no combinations of these would do anything, afaics.

Let me know if you think I'm missing anything; thanks!

Flags: needinfo?(cmills)

This is great, thanks so much Chris.

Closing this bug for now. Please re-open (or edit on MDN) if you see any gaps.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

That's fantastic, thanks so much!

You need to log in before you can comment on or make changes to this bug.