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

Polish up astropy top menubar styling #9

Closed
wants to merge 7 commits into from
Closed

Polish up astropy top menubar styling #9

wants to merge 7 commits into from

Conversation

kakirastern
Copy link
Contributor

@kakirastern kakirastern commented Apr 26, 2019

Based on observations of top menubar rendering generated on RTD.

Fixes #12.

@@ -317,7 +317,7 @@ div.dropdown-content {
background-color: DimGray;
color: White;
width: 235px;
height: 155px;
height: 125px;
Copy link
Member

Choose a reason for hiding this comment

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

what about using the same numbers as in the main webpage?
I believe these are the relevant ones (but please double check whether it's indeed the css that's being used on astropy.org: https://github.com/astropy/astropy.github.com/blob/master/css/style.css#L651)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's what I did originally. But for some reasons things didn't work out then if I use their settings as follows:

.dropdown-content {
...
min-width: 160px;
width: 100%;
height: 100%
...
}

I cannot recall why their code did not work for this case though. But if I use 100% width, I remember getting the full length of the screen instead of that of the individual menu item. (Similarly, if I use 100% for the height, it got rendered to the full height of the screen when I was testing the code, which is not really desirable.)Further, I do know that I have to add in css styling for a new division (.div) called topbar for things to work in my case, which does not exist in their code. I basically reworked everything to get the top menubar working for the docs.

Copy link
Member

@bsipocz bsipocz Apr 26, 2019

Choose a reason for hiding this comment

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

ok, never mind it then (I didn't follow everything in this and prior PRs).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries. I had to resort to using .div to make the menubar work, maybe that's why their code doesn't work on this case.

@astrofrog
Copy link
Member

@kakirastern - two quick requests:

  • Could you make the font size in the dropdown menu match the font size in the top bar itself? At the moment, the dropdown font is a little too large in comparison.

  • Can you increase the spacing between the top bar items slightly and move the dropdown arrow a little closer to 'About' to make it clear it's associated with that item, and not 'Get Help'?

@kakirastern
Copy link
Contributor Author

Sure, give me a day or two and I will get back to you with some more commits as per your requests...

@kakirastern
Copy link
Contributor Author

Hi @astrofrog Please check and let me know if further tweaking is required... I have increased the font size from 110% to 120%, and the spacing between items from 10px to 15px.

@astrofrog
Copy link
Member

It looks like the submenu font is still larger than the main menu font:

Screenshot 2019-05-06 at 14 17 15

And it would be nice if the drop-down arrow was closer to the 'About' word that to the 'Get Help' one. Is that easy to do?

@kakirastern
Copy link
Contributor Author

Sorry, I probably should use px in indicate font size instead... And wait, the part about the drop-down arrow should be easy to fix. Give me a couple of hours. Will be more careful this time.

@kakirastern
Copy link
Contributor Author

So this is what I got locally after tweaking:

Screenshot 2019-05-06 21 43 23

@astrofrog
Copy link
Member

Unfortunately it looks truncated to me now:

Screenshot 2019-05-06 at 15 08 46

This is with Safari and Firefox. Also, the top bar items seem a bit low in terms of vertical alignment - is there any way to center them vertically?

I like the horizontal spacing and the position of the arrow now though!

@kakirastern
Copy link
Contributor Author

Hey @astrofrog, just would like to check with you: Is the image you got from a local build or giles or RTD? If it is a local build then it would look "more normal" after rendering. If it's a giles or RTD rendering it means I will need to do some massaging.

But yes, I can align the top bar items so that they are centered in the topbar. Will work on it now.

@astrofrog
Copy link
Member

It was from a local build

@kakirastern
Copy link
Contributor Author

So this is what I got on a local build to an approximate likeness of the RTD rendering (the items are now more vertically-centered):

Screenshot 2019-05-06 22 46 30

But we should be careful and check with either giles or RTD for the actual topbar...

@kakirastern
Copy link
Contributor Author

In the RTD rendering the spacing between items in the dropdown menu would be smaller...

@kakirastern
Copy link
Contributor Author

Is there any way we can get a giles version of the top bar with the configurations in this branch to check the rendering? Or if your machine produces reliable spacing between dropdown menu items (unlike mine), I can simply go ahead to fix the height of the dropdown menu to accommodate the changes effected in this PR...

@kakirastern
Copy link
Contributor Author

Hi @astrofrog... I trust your computer more than mine, so I just changed the dropdown box height from 125px to 155px. Try it on your machine and see if the dropdown menu still looks "truncated".

@kakirastern
Copy link
Contributor Author

kakirastern commented Jul 11, 2019

Added a new commit as per user suggestion, as made in #12.

@astrofrog
Copy link
Member

@kakirastern - I now no longer see any buttons when the project toolbar is enabled (I think they are pushed below the top bar).

Screenshot 2019-07-20 at 15 36 09

The vertical alignment is also incorrect when the toolbar is not enabled:

Screenshot 2019-07-20 at 15 35 51

@astrofrog
Copy link
Member

Ah the lack of buttons happens disappears if I make the window larger, but they are not visible with the default Chrome window size on my computer.

@kakirastern
Copy link
Contributor Author

Yeah, I think too many buttons got crammed into the topbar... Maybe I could tweak the font size/spacings a bit and see if I can get a better fit. But it will take a few days.

So in summary, I am thinking I will approach the problem via:

  1. Fixing the font size to a smaller one
  2. Changing (reducing) the topbar element size
  3. Tweaking the topbar element spacing

Or, do you have any other suggestions?

@astrofrog
Copy link
Member

I think we might want to consider ways of making the interface responsive, that is on smaller screens, we could switch to a drop-down menu for all those menu buttons? I've been playing around with libraries like Material UI and Vuetify to see what those could offer.

@kakirastern
Copy link
Contributor Author

Yeah, that's a great idea. Right now the sphinx theme has been set up in a way that is hard to change details in an easily and readily deployable manner. Looks like we might run into some issues such as the ones we are encountering or break something like we (or I) did last time sooner or later. I am checking out both Material UI and Vuetify now. I particularly like what Vuetify can do for Astropy...

@astrofrog
Copy link
Member

astrofrog commented Jul 21, 2019

@kakirastern - since you mentioned it on Slack, I'll also mention it here for the record - Bootstrap 4 is also an option and might be easier to use with the kind of templating we need for Sphinx (https://getbootstrap.com/docs/4.3/getting-started/introduction/)

@astrofrog
Copy link
Member

It might be worth investigating whether this bootstrap theme would be a good starting point, with a little tweaking of colors/logo/etc. This is used by the seaborn package for example.

@kakirastern
Copy link
Contributor Author

Sure, I will work on it a bit more. Might take a bit longer than a few days though since I might need to make a lot of changes. Looks like the theme has been modified this year in March 2019 so it is a good sign.

@kakirastern
Copy link
Contributor Author

Will open a separate PR regarding a new-bootstrap-based sphinx theme soon.

@eteq
Copy link
Member

eteq commented Dec 15, 2020

closed at request of author - last SHA was ee41893

@eteq eteq closed this Dec 15, 2020
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.

A couple of small weird things
4 participants