Fix variables when used in an embedded window like on backstage#186
Conversation
|
@pawamoy to hazard nagging you more. Could you review this as well. I don't think the test failure in path based tests could be related to this simple css selector change. |
|
Hey @ElementalWarrior, thanks for the PR! Can you explain to me what is this |
From my understanding, backstage embeds mkdocs in a page using a shadow dom element. And the CSS is just loaded on the page. So the variables in :root don't get picked up. https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM |
|
OK thanks. I don't know enough of HTML/CSS so I'll trust you on this. We can always revert if this causes any issue 🙂 |
pawamoy
left a comment
There was a problem hiding this comment.
I'll just remove the :host occurrences from our own docs.
This is apparently needed when the docs are served under a shadow DOM (for example, Backstage seems to do this, and `:root` variables aren't picked up). See https://developer.mozilla.org/en-US/docs/Web/CSS/:host. PR-186: mkdocstrings/python#186
These variables are not properly defined when using mkdocstrings on a backstage website.