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

Sidebar CSS incorrect leading to wrong indents #126

Open
ijsf opened this issue Sep 30, 2023 · 4 comments
Open

Sidebar CSS incorrect leading to wrong indents #126

ijsf opened this issue Sep 30, 2023 · 4 comments

Comments

@ijsf
Copy link

ijsf commented Sep 30, 2023

I've ran into an issue similar (or identical) to #121. It seems that the sidebar renders classes with and without children with a wrong indent, and this is caused by inconsistenties between the original doxygen .arrow CSS class and the equivalent doxygen-awesome-css class.

One of the root causes is that, unfortunately, doxygen's navtree.js uses a lot of hardcoded pixel values, so it expects certain CSS behaviour.

Bug:
20230930 doxygen awesome bug

Original doxygen theme:
20230930 doxygen original

doxygen's navtree.js generates this for the childless classes:

<div class="item"><span class="arrow" style="width: 64px;">&nbsp;</span><span class="label"><a class="structj_1_1cvar.html" href="structj_1_1cvar.html">cvar</a></span></div>

and generates this for the classes with children:

<div class="item"><a href="javascript:void(0)"><span class="arrow" style="padding-left: 48px;">►</span></a><span class="label"><a class="structj_1_1draw.html" href="structj_1_1draw.html">draw</a></span></div>

The difference here is the arrow element and the use of width and padding-left. The width: 64px doesn't seem to work in doxygen-awesome-css since a <span> with a width element doesn't do anything unless display: inline-block is used. This is absent in the CSS while it is present in the original doxygen CSS.

The following additions from the original doxygen CSS to .arrow (https://github.com/jothepro/doxygen-awesome-css/blob/v2.2.1/doxygen-awesome.css#L846) seem to fix this bug:

display: inline-block;
width: 16px;
@jothepro
Copy link
Owner

jothepro commented Oct 6, 2023

Interesting. Can you give me guidance on how I can reproduce the issue?
What version of Doxygen was used? Is the issue present in all major browsers?

I cannot reproduce it on the demo page unfortunately, even though there seem to be elements with and without children in the same tree, at least in the root of the navigation tree:

Bildschirmfoto 2023-10-06 um 15 29 11

@Rain1560
Copy link

Rain1560 commented Nov 6, 2023

I had reproduced this problem.
doxygen version : 1.9.8
doc.zip
and the darkmode doesnot work well.

@jothepro
Copy link
Owner

jothepro commented Nov 6, 2023

Thank you @Rain1560, with the given example I could reproduce a problem with the tree view navigation (although I am not sure if it is the same bug described by @ijsf).

In your case, it seems like the addition of the bootstrap.min.css in line 43 of the doc/static/header.html template is causing the issues with both the tree view and dark mode.
Removing the additional stylesheet fixes the problem. If you really need bootstrap.min.css, you might have to trace down what style override is causing the problems.

@Rain1560
Copy link

Rain1560 commented Nov 7, 2023

Thank you @Rain1560, with the given example I could reproduce a problem with the tree view navigation (although I am not sure if it is the same bug described by @ijsf).

In your case, it seems like the addition of the bootstrap.min.css in line 43 of the doc/static/header.html template is causing the issues with both the tree view and dark mode. Removing the additional stylesheet fixes the problem. If you really need bootstrap.min.css, you might have to trace down what style override is causing the problems.

I found this problem too. Thanks for your reply.

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

No branches or pull requests

3 participants