Print console.log with custom style

This happen when you tried to open Console panel in Facebook, you will see:

To print a message in Console panel with style like this, you can use the
syntax:

console.log("%c<Your message>", "<css properties>");

For example:

console.log("%cWhy can't fish live out of water", "color: #F00; font-size: 50px;");

Another example, create a Stop message like Facebook:

console.log("%cStop!", "font-size: 50px; color: #F00; text-shadow: 1px 1px #000, -1px -1px #000, -1px 1px #000, 1px -1px #000")

 
0
Kudos
 
0
Kudos

Now read this

Multiple binaries in a Rust project

If you have a project that needs to compile into multiple binaries or libraries, you can config it in Cargo.toml like this: ... [[lib]] name = "<your-lib-name>" src = "<path-to-source>" [[bin]] name =... Continue →

Subscribe to The Full Snack Developer

Don’t worry; we hate spam with a passion.
You can unsubscribe with one click.

S9LXLa7CrucYvIzThg7