Created
October 2, 2021 19:47
-
-
Save elmahdim/801b542fb26a9729f9ab7a853da80e22 to your computer and use it in GitHub Desktop.
Customised console methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Styles | |
const consoleGroupLabelColor = "color: grey;"; | |
const consoleGroupTitleColor = "color: black;"; | |
const red = [ | |
"background-color: #ffebe9;", | |
"color: #82071e;", | |
"font-weight: bold;", | |
]; | |
const green = [ | |
"background-color: #dafbe1;", | |
"color: #116329;", | |
"font-weight: bold;", | |
]; | |
const blue = [ | |
"background-color: #f6f8fa;", | |
"color: #2768da;", | |
"font-weight: bold;", | |
]; | |
// Start console group block | |
console.group(`%c CONSOLE_GROUP_LABEL %c CONSOLE_GROUP_TITLE`, consoleGroupLabelColor, consoleGroupTitleColor); | |
console.log("%c RED ", red.join(""), ...); | |
console.log("%c BLUE ", blue.join(""), ...); | |
console.log("%c GREEN ", green.join(""), ...); | |
// End console group block | |
console.groupEnd(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment