-
Notifications
You must be signed in to change notification settings - Fork 321
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
Issue with field list formatting #193
Comments
That doesn't look good! From looking into this, it seems to be an issue with some css we inherit from sphinx (or the combination of that with css of our theme). Those sphinx "field lists" have this css defining their grid (inherited from dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
} But the problem is that the A quick fix could be to override the above in your dl.field-list {
display: block;
} or, my quick attempt to cook something up with the css grid syntax that doesn't use dl.field-list {
display: grid;
grid-template-columns: auto 80%;
} BTW, we should maybe consider stop inheriting sphinx' basic.css. For that page, if you remove the full content of basic.css, it looks like: The only problem is that bootstrap seems to override the left margin of description list's |
Or maybe the better fix is:
|
@chrisjsewell also, if you prefer the more standard description list layout (also how RTD formats it), you can also use a sphinx definition list instead of field list. See https://pydata-sphinx-theme.readthedocs.io/en/latest/demo/lists_tables.html#definition-lists |
Thanks for looking into this @jorisvandenbossche. Yes personally I would probably have used a definition list, but I didn't write this part of the documentation 😬 The CSS you suggest seems to do the job though, so I'll add that for now. dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) minmax(0, 1fr);
} |
Just a note that I recently found this issue on the numpy NEP page as well: https://pydata-sphinx-theme.readthedocs.io/en/latest/demo/lists_tables.html I'll try and make a quick PR to add the rule described above |
Essentially code blocks (and maybe other elements?) within a field list are not given a max width.
Source text: https://github.com/aiidateam/aiida-core/blob/026f0bf6cacfff645610da5b30b6db426adbd173/docs/source/reference/rest_api.rst
Rendered with pydata theme: https://175-77234579-gh.circle-artifacts.com/0/html/reference/rest_api.html#unique-filters
and if you remove the offending code block:
and the same file rendered with the RTD theme: https://137-77234579-gh.circle-artifacts.com/0/html/reference/rest_api.html#unique-filters
The text was updated successfully, but these errors were encountered: