lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
205 stars 97 forks source link

Switch to flexbox for layout rather than using positioning and margins #58

Closed KarlAustin closed 1 year ago

KarlAustin commented 1 year ago

These two commits switch the normal layout initially to flexbox and then the reverse layout. It removes quite a bit of CSS, especially for the reverse layout and improves the layout of the TOC, menu and content.

Addresses: https://github.com/lukeorth/poison/issues/52

Allows future easier addressing of: https://github.com/lukeorth/poison/issues/51

Normal Layout image

Reverse Layout image

Narrow Width image

As always, happy to take feedback, especially if anyone spots any bugs.

KarlAustin commented 1 year ago

This is what it currently looks like and the same screen:

Normal image

Reverse image

lukeorth commented 1 year ago

Thank you, @KarlAustin - this looks great. I definitely prefer the flexbox approach over what I was using before.

lukeorth commented 1 year ago

@KarlAustin I merged the changes without fully testing, and it looks like change removes the scrollbar on the sidebar menu. I'll have to look into it a bit more, but if we can get that fixed then I definitely want to incorporate your changes. I've reverted it for now though until I can diagnose the issue. :+1:

KarlAustin commented 1 year ago

@KarlAustin I merged the changes without fully testing, and it looks like change removes the scrollbar on the sidebar menu. I'll have to look into it a bit more, but if we can get that fixed then I definitely want to incorporate your changes. I've reverted it for now though until I can diagnose the issue. 👍

Damn it, that's because I'm working on a 4k screen. I can sort that this week.

KarlAustin commented 1 year ago

If you checkout my fork now, you should see that I've fixed the sidebar issue and also another issue on mobile view that I found. Sorry about that.

lukeorth commented 1 year ago

Wow that was quick! Thank you, this looks a lot better. I really like having the page's scrollbar next to the content. It looks much cleaner.

The only issue I'm seeing now is on the list pages. It looks like the dots between a post's title and its published date are getting squished together.

Before: image

After: image

Admittedly the method I'm using to add the dots is a little hacky (just using background-image properties). Because the dots don't actually exist in the DOM, my guess is that flexbox isn't detecting them (and therefore shrinking everything). Any thoughts on how to fix it?

KarlAustin commented 1 year ago

Will try and have a look this weekend if I can.

KarlAustin commented 1 year ago

[EDIT: Doh! I know exactly why mine works, I've got a stupidly long title in there]

I've taken a look, and interestingly I'm not seeing that on my copy here:

image

If I look in the current master branch in poison.css I see:

image

Which takes care of it already with flex and flex-grow.

KarlAustin commented 1 year ago

Okay, I think we should have this nailed now. Really simple fix. Tested with normal and reverse on normal size and mobile.

lukeorth commented 1 year ago

Thanks, @KarlAustin -- this looks fantastic. I am reverting my revert and getting this added in. Thanks again for all the work you've put into this. :100: