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

agogo theme: Wrong use of sidebar* configs #10520

Merged
merged 4 commits into from Jun 16, 2022

Conversation

mgeier
Copy link
Contributor

@mgeier mgeier commented Jun 4, 2022

There are two different things called "sidebar":

  • a part of the "outer" page layout, CSS class sphinxsidebar
  • a kind of text box to be used within the page content using the sidebar directive, CSS class sidebar

The config values sidebarwidth and rightsidebar are supposed to control the former.

Feature or Bugfix

  • Bugfix

@AA-Turner
Copy link
Member

AA-Turner commented Jun 4, 2022

float: right has been there since the theme was created (03aaed9), and the right hand sidebar code has been there since version 2.3.0 (a950df1).

/* Sidebar */
div.sidebar {
width: {{ theme_sidebarwidth }};
float: right;
font-size: .9em;
}

/* Sidebar */
div.sidebar {
width: {{ theme_sidebarwidth|todim }};
{%- if theme_rightsidebar|tobool %}
float: right;
{%- else %}
float: left;
{%- endif %}
font-size: .9em;
}

Has this been wrong for that long?

A

@AA-Turner AA-Turner added this to the 5.1.0 milestone Jun 4, 2022
@mgeier
Copy link
Contributor Author

mgeier commented Jun 4, 2022

Has this been wrong for that long?

Apparently.

But I guess the rightsidebar option is barely used at all, maybe nobody has ever used it with the agogo theme?
And even if somebody has used it, they might not have used the sidebar directive, or they just haven't noticed.

And the wrong sidebar width might also be barely noticeable.

I didn't notice that on a rendered page (does anyone even use agogo?), I just happened to notice it when looking at your PR diff: https://github.com/sphinx-doc/sphinx/pull/10493/files.

@mgeier
Copy link
Contributor Author

mgeier commented Jun 4, 2022

float: right has been there since the theme was created

That's in basic as well, so it has no effect.

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your logic, this CSS is currently incorrect. The theme options page notes:

  • sidebarwidth (CSS length): Width of the sidebar, default 20em.
  • rightsidebar (true or false): Put the sidebar on the right side. Defaults to True.

It is implicit, but reasonably clear, that it is talking about the gutter sidebar rather than the reST .. sidebar:: directive.

A

@mgeier
Copy link
Contributor Author

mgeier commented Jun 5, 2022

I wrote above:

But I guess the rightsidebar option is barely used at all, maybe nobody has ever used it with the agogo theme?

I was wrong, because rightsidebar is set to true by default:

rightsidebar = true

See also https://sphinx-themes.org/sample-sites/default-agogo/.

So the sidebar directive is also right by default, as it is in all other themes.

And with my suggested change, it stays right, even if rightsidebar is set to False.

@AA-Turner AA-Turner merged commit 9ff0812 into sphinx-doc:5.x Jun 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2022
@mgeier mgeier deleted the agogo-sidebarwidth branch July 27, 2022 14:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants