File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
services/static-webserver/client/source/class/osparc/wrapper Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments