Closed spookylukey closed 4 months ago
I threw a PR at your PR to fix the sidebar being too wide on mobile: https://github.com/spookylukey/alabaster/pull/1
Thanks Luke!
A
@AA-Turner You're also welcome on my behalf ;)
Many good PRs were closed, you might want to check this list on my fork for some others to restore: https://github.com/introt/alabester/releases
By my count you have:
Let me know if there was anything else not merged!
A
Looks good to me, thanks for taking a look - the mention links are also good to have for future reference - and thanks for stepping up as a maintainer! It seems there's no longer a need for alabester
, I'll try to find some time to figure out the proper way of deprecating it in favor or the original package.
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 amax-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 totheme_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 amin-width: 876px
breakpoint. Since we can't do 1px adjustment calculations (as above), I inverted the logic, creating an additional section in themax-width: {{ theme_page_width }}
block instead. I've tested and this seems to work fine.