-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Docs: Fix custom styling, restore bullets #12581
Conversation
- Move the custom CSS to a dedicated `pytest.css` file in `_static/`, and reference it from the configuraton's `html_css_files` list. - Update the list-customization styling to only affect `.sidebar-scroll` (the navigation sidebar), so that bullets are visible in the rest of the documentation. - Remove the list indent from the navigation sidebar, but only at the top level, so that navigation is still nested with visible indents.
/* Hide list bullets and top-level indent in TOC sidebar */ | ||
.sidebar-scroll ul {list-style: none;} | ||
.sidebar-scroll > ul {padding-left: 0;} | ||
.sidebar-scroll li {margin: 0.4em 0;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A slight change from @pradyunsg's #12575, as I discovered that the navigation sidebar isn't styled .sidebar
(surprisingly), but the events sidebar is. So, nesting these changes under .sidebar
would've hit the wrong part of the docs.
The navigation content-list is under a div at .sidebar-drawer > .sidebar-container > .sidebar-scroll
.
I suppose I could've used either of those parent selectors instead, except for the .sidebar-scroll > ul
change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, this was not meant for TOC sidebar at all. It's meant for the literal "sidebar" thing in reStructuredText: https://pradyunsg.me/furo/kitchen-sink/generic/#sidebar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that folks didn't like the extra indentation that having list within sidebar, specifically due to lack of width for content in an already thin sidebar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no, pytest devs want list markers in the event sidebar. The original CSS this replaces was intended to remove them only from the TOC/navigation sidebar, but it was overzealous by a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, fun.
for more information, see https://pre-commit.ci
- Prevents it accidentally sitting directly "on top" of other page elements, when the widths work out exactly wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @ferdnyc, we greatly appreciate you following up here. ❤️
I have skimmed through the docs and everything looks great to me. 👍
.sidebar-scroll ul {list-style: none;} | ||
.sidebar-scroll > ul {padding-left: 0;} | ||
.sidebar-scroll li {margin: 0.4em 0;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.sidebar-scroll ul {list-style: none;} | |
.sidebar-scroll > ul {padding-left: 0;} | |
.sidebar-scroll li {margin: 0.4em 0;} | |
.sidebar ul { | |
list-style: none; | |
padding-left: 0; | |
} | |
.sidebar ul li { | |
margin: 0.4em 0; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna say this isn't necessary because I clearly misunderstood what the goals were here.
I'm only now noticing the completely custom sidebar in pytest's documentation. I'll file a separate issue/PR about that, I guess. |
I've filed #12584 for that. |
FWIW, I don't consider my PR to be "competing" with this one and have no concerns with this landing -- I'm happy to rebase mine once this one goes through. I realise that might not have been clear with my previous two comments. 😅 |
Sorry I'm not keen on all the details so I must ask: @pradyunsg in your opinion is this PR ready to merge? |
@ferdnyc @pradyunsg gentle ping |
To be honest, I thought this was already handled with the other PRs that have already been merged. I'll take a look at the current state of the docs and see if anything here is still needed. |
Hmm. Looking at https://docs.pytest.org/en/latest/, list bullets are already back in the main content. They're not shown in the trainings & events sidebar, but the excessive indentation that was being caused when they were hidden is also gone, and I'm not sure my changes here would affect that anyway. And the main/navigation sidebar is completely changed from the previous configs, so my changes there no longer have any purpose. As for the behind-the-scenes changes, the CSS is already moved from I'm not sure there's anything left to do in this PR. All of the linked issues/PRs are already closed/merged. I think it's best to just close this one; everything it was trying to do is handled already. |
Thanks @ferdnyc! |
pytest.css
file in_static/
, and reference it from the configuraton'shtml_css_files
list..sidebar-scroll
(the navigation sidebar), so that bullets are visible in the rest of the documentation.Fixes #12573
Fixes #12576
Closes #12575
Updates #12290
Updates #12326
Before
After