Gilks opened a new issue, #32357:
URL: https://github.com/apache/superset/issues/32357
## Context
I'm embedding dashboards into my SaaS. My SaaS has a toggle that users can
selected that swaps from light to dark mode.
## Problem
For security reasons, you cannot interact with an iframe from a different
origin. This means you're unable to directly modify the CSS within the embedded
iframe. While it is possible to add CSS directly to each dashboard in SuperSet-
this is not ideal as it leads to an administrative nightmare.
## Question
Is it possible to initialize a dashboard with specific CSS? It would be nice
if you could pass in props like this. This would allow the SaaS to dictate what
the theme settings should be when the dashboard is loaded:
```
await embedDashboard({
id: selectedDashboardData.uuid || selectedDashboardData.id,
supersetDomain: process.env.REACT_APP_SUPERSET_DOMAIN,
mountPoint: dashboardRef.current,
fetchGuestToken: () => supersetToken,
dashboardUiConfig: {
hideTitle: true,
hideTab: true,
hideChartControls: true,
cssTemplate: `
.dashboard {
background-color: red !important;
}
`
}
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]