-
Notifications
You must be signed in to change notification settings - Fork 6
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
💄 [#1169] Make images/icons have static sizes in cards #526
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.categories { | ||
&__content { | ||
.card-container { | ||
grid-template-columns: repeat(auto-fit, 228px); | ||
|
||
.card { | ||
max-width: 360px; | ||
} | ||
} | ||
} | ||
|
||
&__products { | ||
margin-top: var(--gutter-width); | ||
|
||
.card-container { | ||
margin-top: var(--gutter-width); | ||
grid-template-columns: repeat(var(--card-columns), 1fr); | ||
|
||
.card { | ||
max-width: 100%; | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// Cards on Home Page and Theme page | ||
|
||
.home { | ||
.card-container { | ||
grid-template-columns: repeat(auto-fit, 228px); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vaszig For mobile: horizontal scrolling will be added later in a different issue so it will look better, but the cards will need to remain this same size. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think @alextreme ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine for now, the scrolling is something Jiro will continue on but these changes are a necessary first step for that. |
||
|
||
.card { | ||
max-width: 360px; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
@import './App.scss'; | ||
@import './body'; | ||
@import './Categories.scss'; | ||
@import './Home.scss'; | ||
@import './Plans.scss'; | ||
@import './product_detail'; | ||
@import './view'; |
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.
We can remove this variable now as the limit is not dynamic any more. Let's use the number directly in each queryset.
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.
In future I may have to make a difference between the mobile limit and the desktop limit, which hopefully can be done in the templates somewhere (not sure yet), so I guess this can be cleaned up.
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.
@vaszig I now see the 'limit' is used 5 times in this file; is it really a good idea to remove the 'limit' variable? I would think it is cleaner to keep it and reuse it instead of the value? (in javascript I would keep the variable, not sure if this is also Python convention).
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 use a variable if I wanted first to evaluate something and then reuse it (Not in Python, in every language). Here we don;t need to evaluate something, it's just an integer. But this is my knowledge, @Bartvaderkin can you tell us your opinion please?
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.
@vaszig @jiromaykin I would keep the variable, so we can see all the usages are linked to the same value. If we'd put the plain number everywhere you get a magic number situation where it isn't clear which numbers are related or just happen to have the same value.
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.
@Bartvaderkin @vaszig Hoorrah! in Javascript I would use a 'const' for numbers like these - so I declare this PR as finished and ready for review again :-)