1
0
Fork 0

sparkles: Styles in debug plugin

This commit is contained in:
Joost De Cock 2018-09-23 12:19:14 +02:00
parent d6fe514f6a
commit 8d1838cab0

View file

@ -1,5 +1,29 @@
import { version, name } from "../package.json";
const color = {
info: "#FFF",
warning: "#FFF",
error: "#FFF",
success: "#FFF"
};
const background = {
info: "#29ABE0",
warning: "#F47C3C",
error: "#d9534f",
success: "#4caf50"
};
/* Returns an object to style debug output */
function debugStyle(type, text) {
let style = `color: ${color[type]};`;
style += `background: ${background[type]};`;
style += "font-weight: 600;";
style += "padding: 0 5px;";
style += "border-radius: 3px;";
return style;
}
export default {
name: name,
version: version,
@ -14,6 +38,15 @@ export default {
u,
g
);
} else if(typeof d === 'object' && typeof d.style !== 'undefined') {
console.log(
"%c"+d.text,
debugStyle(d.style),
e,
b,
u,
g
);
} else {
console.log(
"%cDebug",