Skip to content
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

Nested admonitions are CSS styled incorrectly #331

Closed
Tracked by #649
leifp opened this issue May 5, 2021 · 5 comments · Fixed by #482
Closed
Tracked by #649

Nested admonitions are CSS styled incorrectly #331

leifp opened this issue May 5, 2021 · 5 comments · Fixed by #482
Labels
bug Something isn't working

Comments

@leifp
Copy link

leifp commented May 5, 2021

I don't know if this is a MyST problem or a Sphinx problem, I just noticed it while reading your docs. I can try to figure out exactly where the CSS is being generated if you need me to.

Describe the bug

Nested admonitions are CSS styled incorrectly.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://myst-parser.readthedocs.io/en/latest/using/syntax.html#nesting-directives
  2. The nested "Warning" admonition inherits some of the surrounding "Note" styling, specifically the title bg
    and icon are blue, and the icon is an info-circle.

Expected behavior

The nested "Warning" admonition is styled correctly, specifically the title bg and icon are yellow, and the icon
is an exclamation-triangle.

Environment

Whatever environment generated https://myst-parser.readthedocs.io/en/latest/

I am viewing it with Mozilla Firefox 88.0 (64-bit), on Ubuntu 20.

Towards a Fix

The problem is fixed if the generated CSS is more strict and specifies that the title is a direct child of the
admonition div:

.admonition.warning .admonition-title { /* current, bug */ }
.admonition.warning > .admonition-title { /* seems to fix */ }
@welcome
Copy link

welcome bot commented May 5, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@choldgraf
Copy link
Member

Ah I think this is a sphinx book theme issue. Gonna transfer there!

@welcome
Copy link

welcome bot commented May 6, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@choldgraf choldgraf transferred this issue from executablebooks/MyST-Parser May 6, 2021
@choldgraf choldgraf added the bug Something isn't working label May 6, 2021
@pradyunsg
Copy link
Member

@choldgraf
Copy link
Member

choldgraf commented May 6, 2021

thanks for the pointer @pradyunsg - I realized this is actually also a bug in the PyData theme, so I upstreamed a fix here: pydata/pydata-sphinx-theme#407 which will close this issue as well

@pradyunsg I am jealous of your nicely-structured SCSS for loops and such :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants