Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Correct .page width and padding to visually center #1155

Closed
4 of 5 tasks
justinrummel opened this issue Aug 5, 2017 · 11 comments
Closed
4 of 5 tasks

Correct .page width and padding to visually center #1155

justinrummel opened this issue Aug 5, 2017 · 11 comments

Comments

@justinrummel
Copy link
Contributor

  • This is a question about using the theme.
  • This is a feature request.
  • I have updated all gems with bundle update.
  • I have tested locally with bundle exec jekyll build.
  • I believe this to be a bug with the theme --- not Jekyll, GitHub Pages or one of the bundled plugins.

Environment informations

  • **Minimal Mistakes version: 4.5
  • **github-pages or jekyll gem version: jekyll 3.5.1
  • **Operating system: macOS Sierra 10.12.6

Expected behavior

Page width seems to have changed since 4.5 gem is released

Steps to reproduce the behavior

When viewing on a desktop machine you can see the class .page is set for:

width: 83.05085%;
float: right;
margin-right: 0;
padding-left: 4.23729%;
padding-right: 16.94915%;

screenshot: http://cl.rummel.co/3g0P222s1m3m

w/ gem 4.5 running locally, I see things have changed due to Susy

float: right;
width: 83.0508474576%;
padding-left: 1.6949152542%;
padding-right: 1.6949152542%

screenshot: http://cl.rummel.co/2t3L1H0o3j2j

It seems like padding-left needs a multiplier of 2.5 and padding-right needs a multiplier of 10, unless the MM is changing the presentation intentionally. If so, is there a way to go back to the previous formatting but still using the current version of Susy?

@mmistakes
Copy link
Owner

No way to go back. Susy 3 killed a lot of the mixins I used with the theme and just provides simplified functions. I'll have to see if I can match the math in places it changed.

As long as the layout didn't break I'm cool with some differences.

@dev4223
Copy link

dev4223 commented Aug 6, 2017

I've added a right margin to page class:

.page {

  @include breakpoint($large) {
    float: right;
    width: span(8 of 12);
    margin-right: span(2 of 12);
    padding-left: gutter(0.5 of 12);
    padding-right: gutter(2 of 12);
  }

So it looks the same as before.

Maybe it helps.

@mmistakes
Copy link
Owner

@dev4223 That's close, but the math is still off.

@justinrummel The original intention with was to have the main content appear centered on the page, with equal amounts of white space on the left and right. In the old version with Susy 2, the math wasn't exactly there, but it looked close visually.

I'm going to take another stab at it to try and balance things out since Susy 3 simplified some things. Might be easier to get the math exact.

@mmistakes mmistakes changed the title .page Class change for gem 4.5 Correct .page width and padding to visually center Aug 6, 2017
mmistakes added a commit that referenced this issue Aug 8, 2017
- Center main content on page
- Harmonize sidebar columns to be equal widths

Fixes #1155
@mmistakes
Copy link
Owner

mmistakes commented Aug 8, 2017

Pushed some improvements to get the page and archive layouts where I've always wanted them.

mm-improved-grid

  • Center main content block
  • Fix "table of contents" sidebar overlap and improvement alignment so it fits in the white-space to the right of the main content. Similar to how the author side bar fits to the left.

I haven't merged it into master yet but if you want to give it a spin it's in the layout-adjustments branch and can be used by adding this line to your Gemfile

gem "minimal-mistakes-jekyll", :git => "https://github.com/mmistakes/minimal-mistakes.git", :branch => "layout-adjustments"

@justinrummel
Copy link
Contributor Author

Awesome! I'll try it out this morning

@justinrummel
Copy link
Contributor Author

Wanted to make sure I'm reading this correctly, you want the Table of Contents to be on the right hand side vs. being embedded with the text.

I have an updated screenshot of my current site showing the difference:

If this is the case, it would be nice if TOC could be identified towards the bottom of the markdown, but aligned at the top right. Else, if you but the TOC on the first line you will see the title of the TOC on the main page when post.excerpt is used. ( example: http://cl.rummel.co/0W040k3s0b31 )

@mmistakes
Copy link
Owner

That's right. I wanted to push the TOC out of the main content block since it doesn't always flow well. For instance with code blocks it cuts part of them off. Moving it to the dead space on the right avoids all that.

mm-toc-collision

I pushed a fix that if you place the {% include toc %} further down the page, it will be positioned at the top and align with the main content.

mm-toc-align

I tend to drop the TOC include in after the first paragraph to avoid being pulled into the auto-generated post.excerpt. Placing it at the end of your Markdown file isn't ideal when the page is viewed on mobile when the content collapses down to a single column.

The TOC will be after the content, which defeats the purpose of it.

mm-toc-bottom

Let me know your thoughts and if this works out with your existing content.

@justinrummel
Copy link
Contributor Author

Thanks for the fast turnaround!

  • Desktop view looks GREAT!
  • Mobile view will still inline the TOC where you have the liquid code snippet. Not a big deal from a reading perspective. I wouldn't drop the TOC to the bottom of the page just yet.
  • iPad and iPad Pro views on Google Chrome suggest that the TOC is now on top of the text/images of the post making it unreadable.

iPad

@mmistakes
Copy link
Owner

Should be fixed now. I forgot to include a negative margin for the smaller screen sizes, so the TOC wasn't getting pushed to the right.

@justinrummel
Copy link
Contributor Author

flawless! Going to push it to my main site and let it bake in production.

@mmistakes
Copy link
Owner

Nice. Thanks for testing!

mmistakes added a commit that referenced this issue Aug 8, 2017
* Fix collapsed white-space above pagination links

* Improve `page` and `archive` layout
- Center main content on page
- Harmonize sidebar columns to be equal widths

Fixes #1155

* Update CHANGELOG and history

* Position and align right sidebar with the top of the main content

* Offset right sidebar at `$large` viewport

* Add TOC bottom include test post

* Add right sidebar styling edits to documentation site

* Add TOC bottom include test post
BoWuGit pushed a commit to BoWuGit/bowugit.github.io that referenced this issue Aug 17, 2017
* Fix collapsed white-space above pagination links

* Improve `page` and `archive` layout
- Center main content on page
- Harmonize sidebar columns to be equal widths

Fixes mmistakes#1155

* Update CHANGELOG and history

* Position and align right sidebar with the top of the main content

* Offset right sidebar at `$large` viewport

* Add TOC bottom include test post

* Add right sidebar styling edits to documentation site

* Add TOC bottom include test post
kkunapuli pushed a commit to kkunapuli/kkunapuli.github.io that referenced this issue May 30, 2019
* Fix collapsed white-space above pagination links

* Improve `page` and `archive` layout
- Center main content on page
- Harmonize sidebar columns to be equal widths

Fixes mmistakes#1155

* Update CHANGELOG and history

* Position and align right sidebar with the top of the main content

* Offset right sidebar at `$large` viewport

* Add TOC bottom include test post

* Add right sidebar styling edits to documentation site

* Add TOC bottom include test post
makaroniame added a commit to makaroniame/makaroniame-old.github.io that referenced this issue May 18, 2022
* Fix collapsed white-space above pagination links

* Improve `page` and `archive` layout
- Center main content on page
- Harmonize sidebar columns to be equal widths

Fixes mmistakes#1155

* Update CHANGELOG and history

* Position and align right sidebar with the top of the main content

* Offset right sidebar at `$large` viewport

* Add TOC bottom include test post

* Add right sidebar styling edits to documentation site

* Add TOC bottom include test post
jchwenger pushed a commit to jchwenger/jchwenger.github.io that referenced this issue May 5, 2023
* Fix collapsed white-space above pagination links

* Improve `page` and `archive` layout
- Center main content on page
- Harmonize sidebar columns to be equal widths

Fixes mmistakes#1155

* Update CHANGELOG and history

* Position and align right sidebar with the top of the main content

* Offset right sidebar at `$large` viewport

* Add TOC bottom include test post

* Add right sidebar styling edits to documentation site

* Add TOC bottom include test post
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants