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

Fixed issue #54 - incorrect breakpoints causing clipping #174

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

spookylukey
Copy link

@spookylukey spookylukey commented Jul 22, 2020

As well as fixing the case for the default theme_page_width, it works with customised values too (which was my main motivation for this!)

Analysis/explanation:

  • The issue was a max-width: 875px block that came after a max-width: 870px block.

  • If you are below 875px but not 870px, then you get properties from 875 block only. This gives a very strange 5 pixel window for certain changes, which must be a mistake.

  • Some properties were defined in both 875 and 870 block, and were pointless because these are always overridden by 875 (since if you are below 870 you are always below 875, and the 875 block comes second in the source).

  • So I've combined all these into one block, keeping the 875 blocks values where they differ. In many cases there was just duplication which I removed.

  • I changed the breakpoint width to {{ theme_page_width }}, which gives (almost) the correct behaviour. There is still a slight clipping issue, which is caused by the width of the scrollbar, and the way that browsers include that in width calculations - an issue which, after a lot of Googling, doesn't appear to have any nice solutions. One way would be to just add, say, 20px to theme_page_width but this is not convenient for us to do, since the value we have has units. So for now, I'd recommend just living with this small glitch - it is barely noticeable, and due to margins the page switches layout before any main text is obscured.

  • I've fixed the sidebar breakpoint similarly for fixed_sidebar option. This was at a min-width: 876px breakpoint. Since we can't do 1px adjustment calculations (as above), I inverted the logic, creating an additional section in the max-width: {{ theme_page_width }} block instead. I've tested and this seems to work fine.

spookylukey and others added 2 commits July 22, 2020 10:56
Also now respects theme_page_width for layout switching.
That 102.5% hack breaks at certain resolutions. Unsetting the width here makes it actually 100% wide and never too wide, thus a horizontal scrollbar never appears.
@introt
Copy link

introt commented Jun 21, 2021

I threw a PR at your PR to fix the sidebar being too wide on mobile: spookylukey#1

introt added a commit to introt/docs that referenced this pull request Jun 21, 2021
Implement sphinx-doc/alabaster#174

This addresses the highlighting issue on mobile as well. As I've
"upstreamed" my changes, I've decided to include my one custom line
instead of having a custom.css purely for it.
introt and others added 4 commits June 21, 2021 09:44
tab -> 4 spaces
CSS is not my fav flavor of spaghetti
Fix sidebar width at resolutions right below {{ theme_page_width }}
@bitprophet bitprophet deleted the branch sphinx-doc:master January 13, 2023 00:42
@bitprophet bitprophet closed this Jan 13, 2023
@AA-Turner AA-Turner reopened this Jan 8, 2024
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

Successfully merging this pull request may close these issues.

None yet

4 participants