Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Frontend practice with catalog page using grid
Replace `<your_account>` with your Github username and copy the links to Pull Request description:
- [DEMO LINK](https://<your_account>.github.io/layout_catalog_grid/)
- [DEMO LINK](https://steveforde.github.io/layout_catalog_grid/)

> Follow [this instructions](https://github.com/mate-academy/layout_task-guideline#how-to-solve-the-layout-tasks-on-github)

Expand Down
43 changes: 29 additions & 14 deletions src/styles/_catalog.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
.catalog {
display: flex;
flex-wrap: wrap;
$card-width: 200px;

.catalog {
display: grid;
grid-gap: 48px;
max-width: 944px;
margin: 0 auto;
justify-content: center;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
justify-content: center;
justify-items: center;

align-items: center;

@media (min-width: 1024px) {
grid-template-columns: repeat(4, $card-width);
}

&__card {
display: flex;
justify-content: center;
align-items: center;
width: 200px;
height: 300px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 48px;
@media (min-width: 768px) and (max-width: 1023px) {
grid-template-columns: repeat(3, $card-width);
}

&__card:not(:nth-child(4n)) {
margin-right: 48px;
@media (min-width: 488px) and (max-width: 767px) {
grid-template-columns: repeat(2, $card-width);
}

@media (max-width: 487px) {
grid-template-columns: repeat(1, $card-width);
}
}

.catalog__card {
display: flex;
justify-content: center;
align-items: center;
width: $card-width;
height: 300px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 0;
}