-
-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starlight markdown CSS selector messes with Latex/Katex square roots. #2511
Comments
Thank you for the issue @gbmhunter. I needed to do something similar for a MathJax example which incudes this custom CSS: /* Display SVGs generated by MathJax inline, overriding Starlight’s default `display: block` style for images. */
mjx-container svg {
display: inline !important;
} I’m not sure if there’s a good out-of-the-box approach we can take. Both MathJax and Katex are custom features, so it feels wrong to add styles to handle them when many sites don’t use them. And on the other hand the existing styles are designed to make a simple Do you have any ideas on how best to handle this? |
Going to close this for now as I don’t think it’s necessarily unreasonable to expect some custom markup solutions to also require some custom styles. Although happy to revisit if we have some further ideas about how to approach this. I’ll also note that eventually styling will be even easier with #2322 removing the need for Thanks again for the issue @gbmhunter! |
No worries, if anything this issue will serve as a good tutorial on how to fix it for other people (if search engines pick it up). Thanks for the great work you put into astro.js! Love the framework :-) |
What version of
starlight
are you using?0.28.3
What version of
astro
are you using?4.15.12
What package manager are you using?
npm
What operating system are you using?
Windows
What browser are you using?
Chrome
Describe the Bug
The Starlight CSS rule:
hides Katex (one of the most popular ways of displaying Latex on a webpage) square root symbols.
This is because Katex uses an
svg
to render the square root symbol, and theheight: auto
makes it invisible. One fix is to add this rule tocustom.css
:Katex does not give you the ability to add the
.not-content
class to the parent equation containers, that would have been my first choice for a fix. Perhaps this selector can be modified in Starlight to avoid Katex?Link to Minimal Reproducible Example
https://blog.mbedded.ninja/test/
Participation
The text was updated successfully, but these errors were encountered: