executablebooks / sphinx-tabs

Tabbed views for Sphinx
https://sphinx-tabs.readthedocs.io
MIT License
263 stars 67 forks source link

Trim paragraph margins at the bottom of tab panels #175

Open benjaoming opened 1 year ago

benjaoming commented 1 year ago

This change affects all themes, however the behavior may also be visually problematic in several themes. I only just noticed it in sphinx-rtd-theme.

Themes that aren't affected probably also aren't affected by the margin change, since in this case they probably don't put margins under p elements.

As I understand sphinx-tabs-panel p:last-child, it will trigger if that particular <p> element is the last of all child elements in the tabs panel. So that should work as intended.

Before: image

After:

image

welcome[bot] commented 1 year ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

benjaoming commented 1 year ago

Just noticed https://github.com/executablebooks/sphinx-tabs/pull/143 - the implementation there wouldn't work for panels with several paragraphs.

codecov[bot] commented 1 year ago

Codecov Report

Base: 97.27% // Head: 97.27% // No change to project coverage :thumbsup:

Coverage data is based on head (1feb1f8) compared to base (9431223). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #175 +/- ## ======================================= Coverage 97.27% 97.27% ======================================= Files 2 2 Lines 220 220 ======================================= Hits 214 214 Misses 6 6 ``` | Flag | Coverage Δ | | |---|---|---| | pytests | `97.27% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#carryforward-flags-in-the-pull-request-comment) to find out more. Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.