Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since the Preact app has now been moved into a shadow DOM the app's CSS was no longer working: the `<link>` elements for the app's stylesheets were outside of the shadow DOM where they don't affect the content inside the shadow DOM. The `<link>`'s to the app's stylesheets need to be moved into the shadow DOM. The problem is that the Preact app renders the contents of the shadow DOM, but the stylesheet URLs are only available to the Jinja templates and not available to the Preact app, but the Jinja templates only render the outer page not the contents of the shadow DOM. Get around this by having the Jinja templates pass the stylesheet URLs into the Preact app so that the Preact app can render the `<link>`'s in the shadow DOM: change the `create.html.jinja2` template to render the app's stylesheet URLs in a `"js-config"` object instead of actually rendering them as stylesheet `<link>`'s, then change the Preact app to read the stylesheet URLs from the `"js-config"` object and to render `<link>`'s for the stylesheet URLs into the shadow DOM. This `"js-config"` object can be used more in future when we need the Python code/Jinja templates to pass more configuration into the Preact app.
- Loading branch information