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

Make article width take up whole page in absence of secondary sidebar #771

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

flying-sheep
Copy link
Contributor

@flying-sheep flying-sheep commented Oct 23, 2023

Fixes #736

before: image
after: image

@welcome
Copy link

welcome bot commented Oct 23, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

Copy link
Member

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

Thanks for this improvement - could you please explain the rationale behind the fix? I believe that it works, but I don't understand why setting a max width will improve the case where the content was too narrow. How does a maximum width cause a shrunken container to grow?! Is this some kind of CSS quirk?

@choldgraf choldgraf changed the title Fix article content width Article width should take up whole page in absence of secondary sidebar Oct 31, 2023
@choldgraf choldgraf changed the title Article width should take up whole page in absence of secondary sidebar Make article width take up whole page in absence of secondary sidebar Oct 31, 2023
@flying-sheep
Copy link
Contributor Author

flying-sheep commented Nov 1, 2023

Before my change, _article.scss contained the flex-grow: 0 hack. The hack was there so the absence of a sidebar doesn’t result in a super wide content area, but it had the side effect of making the content area collapse to a super narrow width in that case.

Removing that hack makes it flex-grow: 1 again, so it will grow to fill more than the absolute minimum horizontal space. I then added max-width for making it not take any more space than it should and justify-content: left for not moving to the right (i.e. not centering itself in the space reserved for content and sidebar). Those three changes replace the hack with a more robust solution.

@choldgraf choldgraf merged commit 1b6e9eb into executablebooks:master Nov 1, 2023
13 of 15 checks passed
Copy link

welcome bot commented Nov 1, 2023

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

@choldgraf
Copy link
Member

this is really helpful context, thanks for sharing!

@flying-sheep flying-sheep deleted the fix-no-sidebar branch November 2, 2023 09:40
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.

No right sidebar page width
2 participants