Skip to content

Commit 0b891a4

Browse files
committed
styling
1 parent cdbb141 commit 0b891a4

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

services/static-webserver/client/source/class/osparc/wrapper/JsonFormatter.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,28 @@ qx.Class.define("osparc.wrapper.JsonFormatter", {
7979
},
8080

8181
createContainer: function(divId) {
82-
return new qx.ui.embed.Html("<div id='"+divId+"'></div>");
82+
const container = new qx.ui.embed.Html("<div id='"+divId+"'></div>");
83+
84+
// Inject custom CSS for the JSONFormatter container
85+
const styleId = "json-formatter-custom-style";
86+
if (!document.getElementById(styleId)) {
87+
const color = qx.theme.manager.Color.getInstance().resolve("text");
88+
const style = document.createElement("style");
89+
style.id = styleId;
90+
style.innerHTML = `
91+
#${divId} * {
92+
color: ${color} !important; /* Use your preferred color */
93+
font-family: "Manrope", sans-serif !important;
94+
}
95+
`;
96+
document.head.appendChild(style);
97+
}
98+
99+
return container
83100
},
84101

85102
setData: function(myJSON, divId) {
86-
const formatter = new JSONFormatter(myJSON, 1); // 1 = expand depth
103+
const formatter = new JSONFormatter(myJSON, 2); // 1 = expand depth
87104
document.getElementById(divId).appendChild(formatter.render());
88105
},
89106
}

0 commit comments

Comments
 (0)