pawamoy ยท GitHub

@ElementalWarrior

Copy link Copy Markdown

Contributor

These variables are not properly defined when using mkdocstrings on a backstage website.

@ElementalWarrior

@ElementalWarrior

Copy link Copy Markdown

Contributor Author

@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.

@pawamoy

Copy link Copy Markdown

Member

Hey @ElementalWarrior, thanks for the PR! Can you explain to me what is this :host variable and why it's required for Backstage? Is it a standard thing, or specific to Backstage? Seems like a harmless change anyway, just want to understand.

@ElementalWarrior

Copy link Copy Markdown

Contributor Author

Hey @ElementalWarrior, thanks for the PR! Can you explain to me what is this :host variable and why it's required for Backstage? Is it a standard thing, or specific to Backstage? Seems like a harmless change anyway, just want to understand.

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

@pawamoy

Copy link Copy Markdown

Member

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

pawamoy

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just remove the :host occurrences from our own docs.

@pawamoy

@ElementalWarrior

@ElementalWarrior

viktorlashchuk added a commit to viktorlashchuk/mkdocstrings-python that referenced this pull request

Feb 24, 2025

Read the original on github.com โ†—