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
Mobile overlay fix: works on smaller devices #2346
Mobile overlay fix: works on smaller devices #2346
Conversation
It looks like there’s a vertical scroll bar in the “after” screenshot? So there’s a container around that content which needs to have a change to its height. Probably specific to the settings/preferences and not in this overlay.scss file. I know that I said to make a PR with just the overlay.scss changes so we could fix that later if you want or you could fix it now as part of this PR. |
position: relative; | ||
padding-bottom: #{25 / $base-font-size}rem; | ||
|
||
@media (max-width: 650px) { |
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.
My first instinct was that we should centralize these breakpoints into SCSS and JS variables. Then I thought about it more and we don't necessarily need to use the same breakpoints for every component. The point at which the overlay no longer fits might be different than the point where the nav bar doesn't fit, for example. But if we want to add breakpoints to elements which are rendered as children of an overlay (like the preferences) then those would probably need to use the same breakpoints as the overlay. Curious your thoughts on this.
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.
yeah I agree the breakpoints does not need to be same when they are completely unrelated like the navbar and the overlay
There are some specific issues with specific modals. I DON'T WANT YOU TO FIX THESE. I'm just looking things over to see where we are at. We've always said that the collection lists, etc. would be something that you worked on last only if you had time since your main focus in on the IDE. Maybe we open some issues and let other contributors handle these? Components rendered inside
|
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.
The purpose of this PR is to make overlays fill the screen on mobile devices and you've mostly done that. The one modal-specific issue which I think is worth addressing now is the height of the "fixed height" overlay, only because that is declared in this same _overlay.scss
file. Our intention is that overlays should fill the whole screen on small devices so I think that should apply here too.
p5.js-web-editor/client/styles/components/_overlay.scss
Lines 50 to 53 in 31e64d5
/* Fixed height overlay */ | |
.overlay--is-fixed-height .overlay__body { | |
height: 80vh; | |
} |
We discussed the possibility of writing media queries "mobile first" with the mobile as the default and a min-width
media query for the desktop styles. That might be good here because the height: 80vh;
only applies on .overlay--is-fixed-height
if the min-width
query is met. If we write it desktop-first then we need two styles: height: 80vh
and an override to set it back to height: 100vh;
on small screens. Whereas with mobile-first we only need one style, with a selector and a media query, to apply height: 80vh
. But I'll leave that up to you.
yeah I didn't change that due to the reason that these changes were already present in the mega PR that you made me merge in before I started working, I think that we should get that part of the PR merged in the repo, what are your suggestions on this? |
Yeah I agree, as we leave some of the issues for others to fix, we should mention them in the Issues section, also we can add the good first issue label in them |
I'll check it out, I've never saw this before |
@dewanshDT I'd like to get this PR merged. I think we can fix the fixed height ones by changing the current CSS to this. Can you check it out?
|
Yeah, just a minute |
check it out |
|
||
@media (min-width: 770px) { | ||
height: 80vh; | ||
} |
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 I'm playing with this and my head is exploding 🤯 but I think that height: 100vh;
is actually all that we need? Because the max-height: 80%;
will apply over 651px so that's the same as height: 80vh;
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.
So I should remove the media query then?
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.
Yeah I think so. I don't like to have code that doesn't do anything. The overlay looks good though!
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.
done!
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 a major improvement to mobile usability!
This is a part of mobile responsive project
Changes:
It changes the _overlays.scss file
Before:
After:
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123