jothepro / doxygen-awesome-css

Custom CSS theme for doxygen html-documentation with lots of customization parameters.
https://jothepro.github.io/doxygen-awesome-css/
MIT License
981 stars 112 forks source link

Tweaks to CSS for long templated functions #84

Closed artem-ogre closed 1 year ago

artem-ogre commented 2 years ago

First, I would like to say huge thank you for this project! It is awesome indeed. Applying the theme completely changed the feel of the documentation generated with Doxygen. If feels modern and well looked after. In my opinion this is the experience that Doxygen should aim to provide out of the box.

However, there are some issues with the output for long templated functions: no wrap-around leading to horizontal scrolling and sub-optimal experience especially on mobile devices.

'Before' example:

Screenshot from 2022-08-09 15-20-50

CSS tweaks to improve situation

/* make text of template declarations wrap */
.memItemLeft,
.memTemplItemLeft {
    white-space: normal;
}
.memTemplParams {
    white-space: normal;
}

/* add padding on the right of 'function declaration' block to separate it from 'return value' block */
table.memberdecls .memItemLeft,
table.memberdecls .memTemplItemLeft {
    padding-right: var(--spacing-large);
}

/* add padding on the bottom of 'template parameters' block to separate template parameters from function-declaration and return-value blocks */
table.memberdecls .memTemplParams {
    padding-bottom: var(--spacing-medium);
}

/* change vertical alighment in funciton-declaration block to 'top' to better align return-value and funciton-declaration blocks */
table.memberdecls .memItemRight,
table.memberdecls .memTemplItemRight {
    vertical-align: top;
}

'After' example:

Screenshot from 2022-08-09 15-21-36

Conclusion

These tweaks work quite well for me so I was thinking that it might be something useful for you. What do you think?

jothepro commented 1 year ago

Thanks for sharing your fix! I've adapted parts of it, functions with a lot of template parameters will not break the layout anymore.

But I decided to not allow wrapping the return types like you propose, because I dislike how they are then broken into lines at random positions. 😞 I see how in your case this makes sense because of the very long return types, but I don't want to make it the default (for now).

artem-ogre commented 1 year ago

Great, thanks again!