hehe well you can preload styles if you have this issue when changing theme (i think or my pc is to fast to notice) you can preload styles i put this script on my header docked view.
going from dark to dark-cool nolonger flashes white
code = """<img style='display:none' src='/favicon.ico' onload=\"
if(document.head.childNodes[document.head.childNodes.length-1].getAttribute('rel')=='preload'){return;}
var thisStyle = document.createElement('link');
thisStyle.rel = 'preload';
thisStyle.as = 'style';
thisStyle.href = 'http://localhost:8088/data/perspective/themes/dark.css';
document.head.appendChild(thisStyle);
thisStyle.href = 'http://localhost:8088/data/perspective/themes/dark-cool.css';
document.head.appendChild(thisStyle);
thisStyle.href = 'http://localhost:8088/data/perspective/themes/dark-warm.css';
document.head.appendChild(thisStyle);
\"></img>""".replace("\n", "").replace("\t", "")
return code
the markdown
[
{
"type": "ia.display.markdown",
"version": 0,
"props": {
"markdown": {
"escapeHtml": false
}
},
"meta": {
"name": "Markdown"
},
"position": {
"shrink": 0,
"basis": 0
},
"custom": {},
"propConfig": {
"props.source": {
"binding": {
"type": "expr",
"config": {
"expression": "\"\""
},
"transforms": [
{
"code": "\t\n\tcode = \"\"\"<img style='display:none' src='/favicon.ico' onload=\\\"\n\t\tif(document.head.childNodes[document.head.childNodes.length-1].getAttribute('rel')=='preload'){return;}\n\t\tvar thisStyle = document.createElement('link');\t\t\t\n\t\tthisStyle.rel = 'preload';\n\t\tthisStyle.as = 'style';\n\t\tthisStyle.href = 'http://localhost:8088/data/perspective/themes/dark.css';\n\t\tdocument.head.appendChild(thisStyle);\t\t\n\t\tthisStyle.href = 'http://localhost:8088/data/perspective/themes/dark-cool.css';\n\t\tdocument.head.appendChild(thisStyle);\n\t\tthisStyle.href = 'http://localhost:8088/data/perspective/themes/dark-warm.css';\n\t\tdocument.head.appendChild(thisStyle);\n\t\t\n\t\t\t\t\n\t\\\"></img>\"\"\".replace(\"\\n\", \"\").replace(\"\\t\", \"\")\n\treturn code\n\t\t",
"type": "script"
}
]
}
}
}
}
]
note localhost will probably need to be the ip if your server, i think, check it here when you run it on a client after changing style atleast once: