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

Width of the page in mobile is more than the device width. #139

Closed
shreyasbapat opened this issue Jul 27, 2018 · 9 comments · Fixed by #198
Closed

Width of the page in mobile is more than the device width. #139

shreyasbapat opened this issue Jul 27, 2018 · 9 comments · Fixed by #198
Labels

Comments

@shreyasbapat
Copy link

See this: https://shreyas-poliastro.readthedocs.io/en/alabaster-theme/
All the image widths are relative. I am unable to understand the cause! Please have a look!

@shreyasbapat
Copy link
Author

For example, I tried to build the same docs http://docs.pyinvoke.org/en/1.1/
I got this: https://inb.readthedocs.io/en/hi/
And as you can see, the mobile views in both of them is quite different

@bitprophet bitprophet added the bug label Jul 31, 2018
@shreyasbapat
Copy link
Author

@bitprophet Should I solve this? I have been successful in doing it locally!

@bitprophet
Copy link
Collaborator

Hi, can you provide some screenshots of the specific issue at hand? Not sure exactly what's meant. (Also, the first link up top is a 404 now :() Thanks!

@shreyasbapat
Copy link
Author

Here are the screenshots!
The default behaviour:
screenshot from 2018-08-09 02-43-15
The behaviour after merging that PR:
screenshot from 2018-08-09 02-43-37

These two screenshots are for smae documentation on same screen sizes.

@ags-slc
Copy link

ags-slc commented Nov 6, 2018

Another example, from the popular Requests library:
screen shot 2018-11-06 at 07 55 45

@arxanas
Copy link

arxanas commented Dec 28, 2018

I encountered this as well when writing my own documentation. It is not specific to images.

The problem appears to come from the base Sphinx styles, possibly these lines:

https://github.com/sphinx-doc/sphinx/blob/0a99a58e12e3546ad1df8265e431db061dfb8666/sphinx/themes/basic/static/basic.css_t#L218-L221

I say this because when I poked around in the inspector, I saw these styles applied to div.body:

/* -- general body styles --------------------------------------------------- */

div.body {
    min-width: 450px;
    max-width: 800px;
}

I worked around the issue by adding these lines to my custom.css:

div.body {
    min-width: auto;
    max-width: auto;
}

Here's a picture before my changes, rendered in a small browser window:

screen shot 2018-12-28 at 00 40 31

And after:

screen shot 2018-12-28 at 00 40 39

@shreyasbapat
Copy link
Author

Exactly @arxanas , and I feel this should be shipped with the theme itself.

@amirmasoudabdol
Copy link

Any progress with this? I think this should be prioritized. It's such a simple but essential fix.

@realcr
Copy link

realcr commented May 14, 2020

I stumbled upon this issue today myself. It seems like on mobile phones I get a horizontal scroll bar. I also worked around this issue with a solution similar to @arxanas's.

One interesting observation: I went to check how it works on https://www.paramiko.org. It seems like the bug is not present there, and I think that I managed to figure out why.

When comparing the css files being loaded into my documentation against the ones loaded into paramiko's documentation, the file basic.css seems to be different. Mine has a copyright of :copyright: Copyright 2007-2020 and paramiko's has an older copyright notice: :copyright: Copyright 2007-2018. There are slight differences between the contents of the basic.css files.

In my basic.css (The newer one), there are the following lines:

div.body {
    min-width: 450px;
    max-width: 800px;
}

Those lines are not present in the older basic.css, used by paramiko.org.

I am not sure where is the basic.css file coming from. The copyright line mentions "the Sphinx team". Maybe this issue doesn't originate from alabaster after all?

introt added a commit to introt/docs that referenced this issue Jun 21, 2021
driazati added a commit to driazati/textbook that referenced this issue Oct 18, 2021
First off thanks for the textbook! I'm finding it to be a great learning resource.

I noticed on smaller screens (e.g. phones) that the page had no padding on the right and required scroll out on load to view the whole content. This fixes that by integrating the suggestions from sphinx-doc/alabaster#139 (there should be no change on screens larger than alabaster's hardcoded 450px)

Before:

tbd

After:

tbd
driazati added a commit to driazati/textbook that referenced this issue Oct 18, 2021
First off thanks for the textbook! I'm finding it to be a great learning resource.

I noticed on smaller screens (e.g. phones) that the page had no padding on the right and required scroll out on load to view the whole content. This fixes that by integrating the suggestions from sphinx-doc/alabaster#139 (there should be no change on screens larger than alabaster's hardcoded 450px)

Before:

tbd

After:

tbd
driazati added a commit to driazati/textbook that referenced this issue Oct 18, 2021
First off thanks for the textbook! I'm finding it to be a great learning resource.

I noticed on smaller screens (e.g. phones) that the page had no padding on the right and required scroll out on load to view the whole content. This fixes that by integrating the suggestions from sphinx-doc/alabaster#139 (there should be no change on screens larger than alabaster's hardcoded 450px)

Before:

tbd

After:

tbd
not-my-profile added a commit to not-my-profile/alabaster that referenced this issue Nov 3, 2021
Alabaster inherits from the "basic" theme which sets body_min_width to
450, resulting in body_min_width: 450px, which doesn't make any sense
for Alabaster since it's actually responsive.

Fixes sphinx-doc#139.
alxmrs added a commit to google/weather-tools that referenced this issue Jan 17, 2022
not-my-profile added a commit to not-my-profile/alabaster that referenced this issue Jan 13, 2023
Alabaster inherits from the "basic" theme which sets body_min_width to
450, resulting in body_min_width: 450px, which doesn't make any sense
for Alabaster since it's actually responsive.

Fixes sphinx-doc#139.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants