-
Notifications
You must be signed in to change notification settings - Fork 342
Refactor stylesheets + update typography #101
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
Refactor stylesheets + update typography #101
Conversation
hoetmaaiers
commented
Feb 26, 2020
- Refactor theme.scss + _sphinx-bootstrap.scss into single stylesheet.
- Update typography.
This fixes the yarn build:production script
I think it's a good idea 👍 though see my comment in #100 about using child files for |
It looks nice to me - I'd be +1 on merging and then iterating on things moving forward. A couple quick notes:
|
@hoetmaaiers thanks for getting this started! In general I think it is a really nice improvement (better typography / vertical spacing). Some specific comments on how it looks for the demo site:
|
@choldgraf, do you refer to the whitespace between body and TOC? @jorisvandenbossche , good point about the max-width of the content. The 600px width sneaked into my refactored stylesheet code tbh. Opting for a max-width of 1024px would be my preference too. -- I updated this PR with a larger base font-size, where 1em == 15px. Also the body content will have a max width of 1024px. The specific white space, font-sizes, element widths, ... would be something that I want to tackle and discuss in the full-width work #17. This will be a rework of the existing code and therefore a good opportunity to overhaul these things. What do you think? |
@hoetmaaiers thanks for the update. For your question, I meant the whitespace to the right of the TOC (so the whitespace at the far-right of the page). As @jorisvandenbossche mentions, I feel like on a medium-sized laptop, the whole screen should be taken up (there should be no horizontal white space) I don't see any recent pushes to this PR, can you double-check that it is updated? |
Indeed, I even forgot the commit step 😴. Now it should be here (though minor). |
Hmm - this is how the preview looks on my 13" monitor: I think we should either widen the sidebars, or widen the main content, to fill up a 13" screen at the least. Maybe we could also use some whitespace to have as a sidebar. Sphinx has a |
Hmm, the latest build version of the demo site doesn't seem to have picked up the font size / width change. It is still using the 600px width. |
2c65a21
to
b74ae31
Compare
Now it has. I forgot the step |
Ah - looks much better now. I'm +1 on these typography updates, and I'm assuming that the CSS refactor isn't changing the look of anything? Just a note - things like "I forgot |
I absolutely agree on the cognitive burden which will cause too much trouble when forgotten. Shouldn't we automate this? Ideas:
|
@hoetmaaiers maybe something to open a new issue about? I think it's a good idea to try and design around the confusion as much as possible (though we are also sort-of trading one cognitive overhead for another :-) ) |
Yep, I agree we need to add in place checks to ensure this doesn't happen (or get merged), opened #104 |
|
||
.. currentmodule:: pandas | ||
|
||
.. automethod:: DataFrame.drop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you accidentally added those to the tracked files?
(we might need to add this directory to gitignore if that's not yet the case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is is not yet part of gitignore. Should docs/demo/generated
be added as a whole?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this full /generated/ directory can be added to gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok check.
src/scss/theme.scss
Outdated
margin-bottom: 1.15rem; | ||
|
||
// &.rubric { | ||
// border-bottom: 1px solid rgb(201, 201, 201); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer needed?
You can check it at https://144-130237506-gh.circle-artifacts.com/0/html/demo/generated/pandas.DataFrame.drop.html#pandas.DataFrame.drop, where indeed there is still a line under "Examples". But it is strange that this still seems to come from sphinx-bootstrap.css, which should be removed now ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hoetmaaiers so there still is pandas_sphinx_theme/static/sphinx-bootstrap.css_t that should be removed I think? (since you moved that content into /src/, otherwise it duplicates the css)
That's also the reason that I still see a correct rendering of the "Examples" title (see my comment above). So the "rubric" css above probably needs to be uncommented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spot, this is fixed.
I was also thinking of using a welback clean plugin. This removes the generated output in /static
. This makes it more clear to the committing person that yarn build:production
should be ran or all js & css output is deleted in the commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the demo site, I just noticed that the right sidebar TOC is no longer collapsed (right now in master, it only expands that section where you are while scrolling, as otherwise this TOC can be very long (at least in pandas docs))
The width now seems fine! (and again this starts to look nice ;)) Personally, I still find the overall text size a bit small, but will check tomorrow on a desktop screen (now on my laptop, which also for other sites is often a bit small I find). |
Also, maybe the font size for the items in the top bar can be a bit larger? (but also fine to keep fine tuning several navbars in another PR) |
I'd be +1 on merging this one since it's also a bit of a refactor, and then spot-checking improvements in the future. WDYT @jorisvandenbossche ? |
Yes, I am certainly fine with merging this mostly as is, leaving further style improvements for a next PR. There are only a few thinks that needs to be fixed first (my inline comments). |
src/scss/theme.scss
Outdated
|
||
td:first-child { | ||
white-space: nowrap; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now this seems to be nested inside "table.field-list", while this was originally not the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see the result of that at https://146-130237506-gh.circle-artifacts.com/0/html/demo/api.html#autosummary-table-and-api-stub-pages (compare with the table at https://pandas-sphinx-theme.readthedocs.io/en/latest/demo/api.html#autosummary-table-and-api-stub-pages).
(that's also a reason to preserve the original comments, as that was trying to explain this is specifically for "autosummary tables")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, good remark. Deleted too eagerly.
|
||
/** | ||
* Styling for field lists | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep the comments that were here originally in the new scss file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, brought that back.
Just added back a few more comments ;) |
wohoo! thanks for all your hard work on this one @hoetmaaiers :-) |
Yay, thank you for the comments @jorisvandenbossche, these will come in handy when refactoring with the full width rework. |