Skip to content

Add classes to admonition blocks to distinguish between them #181

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

Closed
choldgraf opened this issue May 20, 2020 · 3 comments · Fixed by #183
Closed

Add classes to admonition blocks to distinguish between them #181

choldgraf opened this issue May 20, 2020 · 3 comments · Fixed by #183

Comments

@choldgraf
Copy link
Collaborator

choldgraf commented May 20, 2020

In executablebooks/sphinx-book-theme#98 we realized that there is no HTML that distinguishes between some admonition blocks because they're mapped on to the same bootstrap class here: https://github.com/pandas-dev/pydata-sphinx-theme/blob/master/pydata_sphinx_theme/bootstrap_html_translator.py#L16.

In those cases, perhaps we should also add another class that makes it possible to distinguish between them. Maybe by adding one extra append to the classes here: https://github.com/pandas-dev/pydata-sphinx-theme/blob/master/pydata_sphinx_theme/bootstrap_html_translator.py#L73 ?

@chrisjsewell
Copy link

Would it be possible to just also add the original class names to the start of the class list, before the bootstrap ones?
I don't believe there are any clashes in these class names with the bootstrap ones, for example in https://sphinx-panels.readthedocs.io I'm using the RTD CSS + Bootstrap CSS.

@jorisvandenbossche
Copy link
Member

Yes, short term we can simply add the original class names I think.

Now, I am also certainly not married to the current approach of using the bootstrap "alert" for the admonitions. That was mainly a quick hack initially to easily style them with bootstrap (but we could probably also style the original adminition classes from sphinx similarly relatively easy, I suppose).

I already long wanted to improve the look of the admonitions, as well (and for example, adding such icons, is something I think we be good to have here in the base theme as well). It seems I still didn't open an issue about that, will do that now.

@jorisvandenbossche
Copy link
Member

Opened an issue about the general admonition styling at #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants