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
Center web app on larger windows sizes #2021
Conversation
Is it just me or would anyone else prefer the column width to just increase slightly to fill the available space instead of having empty bars on either sides? :/ Example: Similar to what @chronister did on cybre.space |
That could work too. It was just annoying me to see it on the left and did it for my instance. I liked it more like this and decided to do this PR. |
I'm not sure what the best way forward is either, however, I think we're not alone in being mildly unhappy with the default "big empty space to the right"-behaviour, and I'd like to get a discussion with some more input going. |
I might PR for this a bit later today, but I really think Mastodon could use a Custom CSS feature. Nothing hardcore, just a string site-setting that gets rendered out in an on-page <style> tag. |
woganmay, 1.2 added a custom.scss file that can be installed as app/assets/stylesheets/custom.scss. You should do "@import 'application';" in it. Above the import, you can define $color1 through $color9 to change some of the main colors, and below the import, you can override existing styles. (i'm not familiar enough with SCSS to say if it doesn't matter where you put the definitions, i figured putting the variables at the top would define them for the import, and putting overrides at the bottom would take precedence over the import) That said, the CSS inside the application can be very complex, and you should thoroughly test every change you make, as it may have cascading side effects beyond what you intended, as is the nature of CSS. Particularly, the $color variables, have huge sweeping effects, and changing them to tones that aren't roughly equivalent to the current levels can make your public pages look like a nightmare, despite your UI looking great, or vice versa. I would like to see (or create, if no one gets to it before I do.. busy life.. sigh) a lot more colors broken out into specific variables, instead of being relative to other values. |
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.
There's currently a rule for @media screen and (min-width: 2560px)
which means that on very large screens, what you are describing already happens.
Do you want to look at that rule and see if the min-width there can be reduced instead of adding this new rule? Or did you already do that and this needs to be separate?
@mjankowski I didn't even see that rule + I don't have a screen to test 2560px :) The min-width of 1300px rule is because each column uses 300px and all padding+margins 100px. If we account for the +50px per column on the 2560px rule, the rule I proposed needed to change to at least 1500px. This causes 2 issues:
I did some testing and I believe we need 2 rules for this. I would suggest, closing this PR and submitting a new one with the following changes to mastodon/app/assets/stylesheets/components.scss
PreviewWindows larger than 1300px and less 1900px (window in the image 1680px) Windows larger than 1900px (window in the image 1920px) Notice that I changed the column size to 400px and the top and bottom margins to 2vh. Sorry for the huge comment, just wanted to be clear :) what do you think should I close this PR and submit a new one with the mentioned changes or should we wait for other solutions? |
That was a very thorough and well explained change! If you want to either change this PR or open a new PR with those changes ... either way is fine. |
@mjankowski Sorry, I suck at Git and didn't know it was this easy to do the changes :P Did the changes and tested it on my live instance, it is working as expected. |
Looks slick! |
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.
Does this actually accomplish the centering now?
I would think you'd need something like margin: 0 auto;
in the outer thing...
@mjankowski Yes it does. I tested it. |
Can you rebase and confirm? I made that change locally and don't see it centered anymore ... it's possible something changed in master since you did this? |
@mjankowski I deleted my development instance. I will try and install a new one to test this. Can't promise it will be today but tomorrow tops. |
@mjankowski sorry about the delay, only now could get a development instance up. |
From #2327 - Elephant friend was overlapping with text, oversized in single column layout From #2021 - Centered layout goes against design principles, changes UX for everybody who's already used to the current one From #2271 - CPU/RAM overusage from keeping columns in DOM (fix #2648, possibly also #2101)
From #2327 - Elephant friend was overlapping with text, oversized in single column layout From #2021 - Centered layout goes against design principles, changes UX for everybody who's already used to the current one From #2271 - CPU/RAM overusage from keeping columns in DOM (fix #2648, possibly also #2101)
On larger screens the web app aligns to the left:
With this commit it would center: