-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix/logos #1097
Fix/logos #1097
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.
LGTM. I had some questions and remarks but I'll let you decide what to do with them :-)
@media (max-width: 500px) { | ||
margin-left: 10px; | ||
height: $logo-height-mobile; | ||
} |
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.
I would develop mobile-first and then use min-width
to make exceptions for larger devices instead of vice versa.
color: transparent; | ||
width: 30%; | ||
|
||
@media (max-width: 500px) { |
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.
I see you are using a breakpoint of 500px
here. I just checked and found that MUSCLE's codebase now has breakpoints of 320, 350, 420, 500, 520, and 720 px.
First of all, I think that's an excessive amount. Maybe we can simplify that in the future and have only 2-3, maybe 4 breakpoints max.
Second, we already have breakpoints defined in variables.scss
. Why not use those or add the ones you are using here?
MUSCLE/frontend/src/scss/variables.scss
Lines 28 to 33 in 38669ad
// breakpoints | |
$breakpoint-xs: 0; | |
$breakpoint-sm: 576px; | |
$breakpoint-md: 768px; | |
$breakpoint-lg: 992px; | |
$breakpoint-xl: 1200px; |
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.
I totally agree that we should clean this up. I copied and pasted this breakpoint from former code. I'll see about reusing the breakpoint from variables here instead.
.aha__dashboard { | ||
|
||
.aha__logo { | ||
margin-left: 35%; |
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.
What's the reason for using a percentage as margin? Should it scale with device width?
'logoUrl': f'{settings.BASE_URL.strip("/")}/{settings.MEDIA_URL.strip("/")}/{str(theme.logo_image.file)}' if theme.logo_image else None, | ||
'backgroundUrl': f'{settings.BASE_URL.strip("/")}/{settings.MEDIA_URL.strip("/")}/{str(theme.background_image.file)}' if theme.background_image else None, |
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.
Can't you use the serialize_image
method like in the other PRs of today?
MUSCLE/backend/image/serializers.py
Lines 8 to 13 in 38669ad
def serialize_image(image: Image) -> dict: | |
return { | |
'file': f'{settings.BASE_URL.strip("/")}/{settings.MEDIA_URL.strip("/")}/{image.file}', | |
'href': image.href, | |
'alt': image.alt, | |
} |
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.
Eventually, that's 100% the better way, yes. For now, the frontend changes involved to adapt to the objects here are kind of daunting (especially to use the href defined in the images).
This branch ensures that logos will be displayed correctly, i.e., centered and big on the dashboard, and smaller top-left for the experiments (these would require defining separate themes for now).