-
Notifications
You must be signed in to change notification settings - Fork 213
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
style(avatar): oversizing of avatar on small screens #757
Conversation
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.
Thanks @hritvi, and sorry for the delay reviewing!
I tested this today and it's an improvement for tall images, I think it can be improved for wide images.
For example, on a mobile screen, when I first load an image there is still a black border to left even though the image isn't centered and the right is cropped.
If I go into "tablet" mode, then there is a large black space to the right rather than the left:
I suspect CSS isn't the only thing at play here, the cropper sets the top and left of the image and may need updated for mobile.
Also, we really try hard to not use !important
within CSS unless absolutely necessary. See https://css-tricks.com/when-using-important-is-the-right-choice/ for a good reference.
|
||
img { | ||
position: absolute; | ||
@include respond-to('small') { | ||
left: (420 - $avatar-size) / 6 !important; |
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.
Is the !important
really needed here? Is there a way to do without?
I think @shane-tomlinson already had this in review - pending some requested changes |
Sorry, I actually got a little busy with my exams stuff. Now that they are over, I would complete it as soon as possible. |
I tried to modify the scripts written in the cropper a lot but nothing changed the position of the image. I guess that works when the image is zoomed or something like that. I even tried to change the horizontal and vertical gutter in avatar_crop but that wasn't working too. I guess we have to modify some code written in the CSS file. I figured out that it seems to work perfectly for screen sizes greater than 420. The only reason I could figure out for it was that the code was written in a way to support screen sizes greater than 420px and that's why 420 is taken as the base to distribute the left and right padding. |
@shane-tomlinson @lmorchard can I get some insights into this? |
We have decided to put this on hold for now to focus on the React project. We can re-open this PR if/when we get back to it. |
fixes #661
ref #7051.
For a tall sample image:

@lmorchard could you please review it now. Thanks!!